mstask: Write correct trigger count to a job file.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-04-26 17:17:35 +08:00 committed by Alexandre Julliard
parent ce57e5c4d7
commit e7987b1e4b
1 changed files with 3 additions and 3 deletions

View File

@ -1133,9 +1133,6 @@ static HRESULT write_triggers(ITask *task, HANDLE hfile)
hr = ITask_GetTriggerCount(task, &count);
if (hr != S_OK) return hr;
if (!WriteFile(hfile, &count, sizeof(count), &size, NULL))
return HRESULT_FROM_WIN32(GetLastError());
/* Windows saves a .job with at least 1 trigger */
if (!count)
{
@ -1146,6 +1143,9 @@ static HRESULT write_triggers(ITask *task, HANDLE hfile)
count = 1;
}
if (!WriteFile(hfile, &count, sizeof(count), &size, NULL))
return HRESULT_FROM_WIN32(GetLastError());
for (i = 0; i < count; i++)
{
TASK_TRIGGER task_trigger;