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

mstask: Implement ITask::GetIdleWait().

parent 9d113d35
...@@ -40,6 +40,7 @@ typedef struct ...@@ -40,6 +40,7 @@ typedef struct
IExecAction *action; IExecAction *action;
LPWSTR task_name; LPWSTR task_name;
HRESULT status; HRESULT status;
WORD idle_minutes, deadline_minutes;
DWORD maxRunTime; DWORD maxRunTime;
LPWSTR accountName; LPWSTR accountName;
} TaskImpl; } TaskImpl;
...@@ -190,13 +191,15 @@ static HRESULT WINAPI MSTASK_ITask_SetIdleWait( ...@@ -190,13 +191,15 @@ static HRESULT WINAPI MSTASK_ITask_SetIdleWait(
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI MSTASK_ITask_GetIdleWait( static HRESULT WINAPI MSTASK_ITask_GetIdleWait(ITask *iface, WORD *idle_minutes, WORD *deadline_minutes)
ITask* iface,
WORD *pwIdleMinutes,
WORD *pwDeadlineMinutes)
{ {
FIXME("(%p, %p, %p): stub\n", iface, pwIdleMinutes, pwDeadlineMinutes); TaskImpl *This = impl_from_ITask(iface);
return E_NOTIMPL;
TRACE("(%p, %p, %p): stub\n", iface, idle_minutes, deadline_minutes);
*idle_minutes = This->idle_minutes;
*deadline_minutes = This->deadline_minutes;
return S_OK;
} }
static HRESULT WINAPI MSTASK_ITask_Run( static HRESULT WINAPI MSTASK_ITask_Run(
...@@ -840,6 +843,8 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t ...@@ -840,6 +843,8 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t
This->task = taskdef; This->task = taskdef;
This->task_name = heap_strdupW(task_name); This->task_name = heap_strdupW(task_name);
This->status = SCHED_S_TASK_NOT_SCHEDULED; This->status = SCHED_S_TASK_NOT_SCHEDULED;
This->idle_minutes = 10;
This->deadline_minutes = 60;
This->accountName = NULL; This->accountName = NULL;
/* Default time is 3 days = 259200000 ms */ /* Default time is 3 days = 259200000 ms */
......
...@@ -502,7 +502,7 @@ static void test_task_state(void) ...@@ -502,7 +502,7 @@ static void test_task_state(void)
BOOL setup; BOOL setup;
HRESULT hr, status; HRESULT hr, status;
DWORD flags; DWORD flags;
WORD val1; WORD val1, val2;
setup = setup_task(); setup = setup_task();
ok(setup, "Failed to setup test_task\n"); ok(setup, "Failed to setup test_task\n");
...@@ -547,6 +547,16 @@ static void test_task_state(void) ...@@ -547,6 +547,16 @@ static void test_task_state(void)
hr = ITask_GetErrorRetryInterval(test_task, &val1); hr = ITask_GetErrorRetryInterval(test_task, &val1);
ok(hr == E_NOTIMPL, "got %#x\n", hr); ok(hr == E_NOTIMPL, "got %#x\n", hr);
if (0) /* crashes under Windows */
hr = ITask_GetIdleWait(test_task, NULL, NULL);
val1 = 0xdead;
val2 = 0xbeef;
hr = ITask_GetIdleWait(test_task, &val1, &val2);
ok(hr == S_OK, "got %#x\n", hr);
ok(val1 == 10, "got %u\n", val1);
ok(val2 == 60, "got %u\n", val2);
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