taskschd: Add invalid parameter check to IRegisteredTask::get_State and IRegisteredTask::get_Enabled.

This commit is contained in:
Dmitry Timoshkov 2014-04-10 17:41:22 +09:00 committed by Alexandre Julliard
parent 9595526932
commit ea248186b3
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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);