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

taskschd: Add invalid parameter check to IRegisteredTask::get_State and…

taskschd: Add invalid parameter check to IRegisteredTask::get_State and IRegisteredTask::get_Enabled.
parent 95955269
......@@ -157,6 +157,8 @@ static HRESULT WINAPI regtask_get_State(IRegisteredTask *iface, TASK_STATE *stat
TRACE("%p,%p\n", iface, state);
if (!state) return E_POINTER;
return SchRpcGetTaskInfo(regtask->path, SCH_FLAG_STATE, &enabled, state);
}
......@@ -168,6 +170,8 @@ static HRESULT WINAPI regtask_get_Enabled(IRegisteredTask *iface, VARIANT_BOOL *
TRACE("%p,%p\n", iface, v_enabled);
if (!v_enabled) return E_POINTER;
hr = SchRpcGetTaskInfo(regtask->path, 0, &enabled, &state);
if (hr == S_OK)
*v_enabled = enabled ? VARIANT_TRUE : VARIANT_FALSE;
......
......@@ -909,6 +909,11 @@ todo_wine
todo_wine
ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool);
hr = IRegisteredTask_get_State(task2, NULL);
ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr);
hr = IRegisteredTask_get_Enabled(task2, NULL);
ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr);
IRegisteredTask_Release(task2);
hr = ITaskFolder_DeleteTask(folder, NULL, 0);
......
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