mstask: Implement ITask::GetStatus().

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-04-20 16:37:08 +08:00 committed by Alexandre Julliard
parent cbe3300b1e
commit 5907782d59
2 changed files with 20 additions and 8 deletions

View File

@ -39,6 +39,7 @@ typedef struct
ITaskDefinition *task;
IExecAction *action;
LPWSTR task_name;
HRESULT status;
DWORD maxRunTime;
LPWSTR accountName;
} TaskImpl;
@ -229,12 +230,14 @@ static HRESULT WINAPI MSTASK_ITask_GetMostRecentRunTime(
return E_NOTIMPL;
}
static HRESULT WINAPI MSTASK_ITask_GetStatus(
ITask* iface,
HRESULT *phrStatus)
static HRESULT WINAPI MSTASK_ITask_GetStatus(ITask *iface, HRESULT *status)
{
FIXME("(%p, %p): stub\n", iface, phrStatus);
return E_NOTIMPL;
TaskImpl *This = impl_from_ITask(iface);
TRACE("(%p, %p)\n", iface, status);
*status = This->status;
return S_OK;
}
static HRESULT WINAPI MSTASK_ITask_GetExitCode(
@ -840,6 +843,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t
This->ref = 1;
This->task = taskdef;
This->task_name = heap_strdupW(task_name);
This->status = SCHED_S_TASK_NOT_SCHEDULED;
This->accountName = NULL;
/* Default time is 3 days = 259200000 ms */

View File

@ -2,6 +2,7 @@
* Test suite for Task interface
*
* Copyright (C) 2008 Google (Roy Shea)
* Copyright (C) 2018 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -496,10 +497,10 @@ static void test_SetAccountInformation_GetAccountInformation(void)
return;
}
static void test_GetFlags(void)
static void test_task_state(void)
{
BOOL setup;
HRESULT hr;
HRESULT hr, status;
DWORD flags;
setup = setup_task();
@ -526,6 +527,13 @@ static void test_GetFlags(void)
ok(hr == S_OK, "GetTaskFlags error %#x\n", hr);
ok(flags == 0, "got %#x\n", flags);
if (0) /* crashes under Windows */
hr = ITask_GetStatus(test_task, NULL);
status = 0xdeadbeef;
hr = ITask_GetStatus(test_task, &status);
ok(status == SCHED_S_TASK_NOT_SCHEDULED, "got %#x\n", status);
cleanup_task();
}
@ -538,6 +546,6 @@ START_TEST(task)
test_SetComment_GetComment();
test_SetMaxRunTime_GetMaxRunTime();
test_SetAccountInformation_GetAccountInformation();
test_GetFlags();
test_task_state();
CoUninitialize();
}