taskschd: Add invalid parameter check to IRegisteredTask::get_State and IRegisteredTask::get_Enabled.
This commit is contained in:
parent
9595526932
commit
ea248186b3
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue