[PATCH 3/3] mstask: Write correct trigger count to a job file.

Dmitry Timoshkov dmitry at baikal.ru
Thu Apr 26 04:17:35 CDT 2018


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/mstask/task.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index f93aff1ccb..986faa1654 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -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;
-- 
2.16.3




More information about the wine-devel mailing list