taskschd: Don't accept task XML with an invalid boolean value.
This commit is contained in:
parent
d2fc6b3145
commit
39f0b276c7
|
@ -1553,8 +1553,8 @@ static HRESULT read_variantbool_value(IXmlReader *reader, VARIANT_BOOL *vbool)
|
|||
*vbool = VARIANT_FALSE;
|
||||
else
|
||||
{
|
||||
FIXME("unexpected bool value %s\n", debugstr_w(value));
|
||||
return E_FAIL;
|
||||
WARN("unexpected bool value %s\n", debugstr_w(value));
|
||||
return SCHED_E_INVALIDVALUE;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -1826,62 +1826,62 @@ static HRESULT read_settings(IXmlReader *reader, ITaskSettings *taskset)
|
|||
else if (!lstrcmpW(name, DisallowStartIfOnBatteries))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_DisallowStartIfOnBatteries(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_DisallowStartIfOnBatteries(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, AllowStartOnDemand))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_AllowDemandStart(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_AllowDemandStart(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, StopIfGoingOnBatteries))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_StopIfGoingOnBatteries(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_StopIfGoingOnBatteries(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, AllowHardTerminate))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_AllowHardTerminate(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_AllowHardTerminate(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, StartWhenAvailable))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_StartWhenAvailable(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_StartWhenAvailable(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, RunOnlyIfNetworkAvailable))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_RunOnlyIfNetworkAvailable(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_RunOnlyIfNetworkAvailable(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, Enabled))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_Enabled(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_Enabled(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, Hidden))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_Hidden(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_Hidden(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, RunOnlyIfIdle))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_RunOnlyIfIdle(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_RunOnlyIfIdle(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, WakeToRun))
|
||||
{
|
||||
hr = read_variantbool_value(reader, &bool_val);
|
||||
if (hr == S_OK)
|
||||
ITaskSettings_put_WakeToRun(taskset, bool_val);
|
||||
if (hr != S_OK) return hr;
|
||||
ITaskSettings_put_WakeToRun(taskset, bool_val);
|
||||
}
|
||||
else if (!lstrcmpW(name, ExecutionTimeLimit))
|
||||
{
|
||||
|
|
|
@ -1246,7 +1246,6 @@ todo_wine
|
|||
|
||||
MultiByteToWideChar(CP_ACP, 0, xml7, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0]));
|
||||
hr = ITaskDefinition_put_XmlText(taskdef, xmlW);
|
||||
todo_wine
|
||||
ok(hr == SCHED_E_INVALIDVALUE, "expected SCHED_E_INVALIDVALUE, got %#x\n", hr);
|
||||
|
||||
ITaskDefinition_Release(taskdef);
|
||||
|
|
Loading…
Reference in New Issue