mstask: Implement ITask::SetFlags().

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-05-14 15:49:12 +08:00 committed by Alexandre Julliard
parent 0ec4e9d216
commit bad78747f6
2 changed files with 45 additions and 4 deletions

View File

@ -491,11 +491,14 @@ static HRESULT WINAPI MSTASK_ITask_GetErrorRetryInterval(ITask *iface, WORD *int
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI MSTASK_ITask_SetFlags( static HRESULT WINAPI MSTASK_ITask_SetFlags(ITask *iface, DWORD flags)
ITask* iface,
DWORD dwFlags)
{ {
FIXME("(%p, 0x%08x): stub\n", iface, dwFlags); TaskImpl *This = impl_from_ITask(iface);
TRACE("(%p, 0x%08x)\n", iface, flags);
This->flags &= 0xffff8000;
This->flags |= flags & 0x7fff;
This->is_dirty = TRUE;
return S_OK; return S_OK;
} }

View File

@ -683,6 +683,43 @@ static void test_Run(void)
ok(hr == S_OK, "got %#x\n", hr); ok(hr == S_OK, "got %#x\n", hr);
} }
static void test_SetFlags(void)
{
HRESULT hr;
ITask *task;
DWORD flags;
hr = ITaskScheduler_NewWorkItem(scheduler, task_name, &CLSID_CTask,
&IID_ITask, (IUnknown **)&task);
ok(hr == S_OK, "got %#x\n", hr);
hr = ITask_SetFlags(task, 0);
ok(hr == S_OK, "got %#x\n", hr);
flags = 0xdeadbeef;
hr = ITask_GetFlags(task, &flags);
ok(hr == S_OK, "got %#x\n", hr);
ok(flags == 0, "got %#x\n", flags);
hr = ITask_SetFlags(task, 0xffffffff);
ok(hr == S_OK, "got %#x\n", hr);
flags = 0xdeadbeef;
hr = ITask_GetFlags(task, &flags);
ok(hr == S_OK, "got %#x\n", hr);
ok(flags == 0x7fff, "got %#x\n", flags);
hr = ITask_SetFlags(task, 0x9234);
ok(hr == S_OK, "got %#x\n", hr);
flags = 0xdeadbeef;
hr = ITask_GetFlags(task, &flags);
ok(hr == S_OK, "got %#x\n", hr);
ok(flags == 0x1234, "got %#x\n", flags);
ITask_Release(task);
}
START_TEST(task) START_TEST(task)
{ {
HRESULT hr; HRESULT hr;
@ -700,6 +737,7 @@ START_TEST(task)
test_SetAccountInformation_GetAccountInformation(); test_SetAccountInformation_GetAccountInformation();
test_task_state(); test_task_state();
test_Run(); test_Run();
test_SetFlags();
ITaskScheduler_Release(scheduler); ITaskScheduler_Release(scheduler);
CoUninitialize(); CoUninitialize();