From a3cd93ca9602406b4891136101167c5444101391 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 9 Apr 2014 18:51:03 +0900 Subject: [PATCH] taskschd: Forward IRegisteredTask::get_Enabled to SchRpcGetTaskInfo. --- dlls/taskschd/regtask.c | 14 +++++++++++--- dlls/taskschd/tests/scheduler.c | 13 +++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/taskschd/regtask.c b/dlls/taskschd/regtask.c index 038315f7567..e224b3e8f57 100644 --- a/dlls/taskschd/regtask.c +++ b/dlls/taskschd/regtask.c @@ -160,10 +160,18 @@ static HRESULT WINAPI regtask_get_State(IRegisteredTask *iface, TASK_STATE *stat return SchRpcGetTaskInfo(regtask->path, SCH_FLAG_STATE, &enabled, state); } -static HRESULT WINAPI regtask_get_Enabled(IRegisteredTask *iface, VARIANT_BOOL *enabled) +static HRESULT WINAPI regtask_get_Enabled(IRegisteredTask *iface, VARIANT_BOOL *v_enabled) { - FIXME("%p,%p: stub\n", iface, enabled); - return E_NOTIMPL; + RegisteredTask *regtask = impl_from_IRegisteredTask(iface); + DWORD enabled, state; + HRESULT hr; + + TRACE("%p,%p\n", iface, v_enabled); + + hr = SchRpcGetTaskInfo(regtask->path, 0, &enabled, &state); + if (hr == S_OK) + *v_enabled = enabled ? VARIANT_TRUE : VARIANT_FALSE; + return hr; } static HRESULT WINAPI regtask_put_Enabled(IRegisteredTask *iface, VARIANT_BOOL enabled) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 7498b708d26..e54e6ee9ead 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -818,9 +818,7 @@ todo_wine ok(hr == S_OK, "get_State error %#x\n", hr); ok(state == TASK_STATE_DISABLED, "expected TASK_STATE_DISABLED, got %d\n", state); hr = IRegisteredTask_get_Enabled(task1, &vbool); -todo_wine ok(hr == S_OK, "get_Enabled error %#x\n", hr); -if (hr == S_OK) ok(vbool == VARIANT_FALSE, "expected VARIANT_FALSE, got %d\n", vbool); IRegisteredTask_Release(task1); @@ -846,9 +844,8 @@ if (hr == S_OK) todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task2, &vbool); -todo_wine ok(hr == S_OK, "get_Enabled error %#x\n", hr); -if (hr == S_OK) +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); IRegisteredTask_Release(task2); @@ -875,9 +872,7 @@ todo_wine ok(hr == S_OK, "get_State error %#x\n", hr); ok(state == TASK_STATE_DISABLED, "expected TASK_STATE_DISABLED, got %d\n", state); hr = IRegisteredTask_get_Enabled(task1, &vbool); -todo_wine ok(hr == S_OK, "get_Enabled error %#x\n", hr); -if (hr == S_OK) ok(vbool == VARIANT_FALSE, "expected VARIANT_FALSE, got %d\n", vbool); hr = IRegisteredTask_put_Enabled(task1, VARIANT_TRUE); @@ -888,9 +883,8 @@ todo_wine todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task1, &vbool); -todo_wine ok(hr == S_OK, "get_Enabled error %#x\n", hr); -if (hr == S_OK) +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); IRegisteredTask_Release(task1); @@ -911,9 +905,8 @@ if (hr == S_OK) todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task2, &vbool); -todo_wine ok(hr == S_OK, "get_Enabled error %#x\n", hr); -if (hr == S_OK) +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); IRegisteredTask_Release(task2); -- 2.11.4.GIT