Commit Graph

76 Commits

Author SHA1 Message Date
Michael Stefaniuc 5d066f4f7a mstask: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 11:47:49 +01:00
Alexandre Julliard da15e5cb37 mstask: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 14:41:50 +02:00
Michael Stefaniuc b7f5e4ae5f mstask: Avoid using the comma operator.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-25 10:12:49 +01:00
Sven Baars 3804b99e72 mstask: Fix some memory leaks on error path (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-06 19:57:27 +01:00
Dmitry Timoshkov f1ca1180cc mstask: Avoid an infinite loop.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-27 10:07:00 +02:00
Dmitry Timoshkov 26975bfbef mstask: Use current time as trigger begin time when necessary.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-27 10:06:54 +02:00
Dmitry Timoshkov c5d945c9f7 mstask: Implement ITask::GetWorkItemData().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Dmitry Timoshkov c00fbb5c0e mstask: Implement ITask::SetWorkItemData().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Dmitry Timoshkov 70ca4ecd14 mstask: Retry opening a .job file only in case of sharing violation.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-12 23:48:47 +02:00
Dmitry Timoshkov 9eca94fc12 mstask: Implement ITask::GetExitCode().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-11 12:00:54 +02:00
Dmitry Timoshkov 5c85a24310 mstask: Retry with a timeout if opening a job file has failed.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-31 20:00:38 +02:00
Dmitry Timoshkov 5f895673df mstask: Implement ITask::GetMostRecentRunTime().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-31 20:00:38 +02:00
Dmitry Timoshkov 8587b4788b mstask: Keep the job file uuid across load/save operations.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 12:40:33 +02:00
Dmitry Timoshkov aad4302998 mstask: Avoid an infinite loop in ITask::GetNextRunTime() if weekly trigger runs every week.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-23 09:55:37 +02:00
Dmitry Timoshkov 5a9ed96aec mstask: Implement ITask::GetNextRunTime() for WEEKLY trigger type.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-22 10:24:59 +02:00
Dmitry Timoshkov 2a56402c56 mstask: Add support for event triggers to ITask::GetNextRunTime().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-22 10:24:57 +02:00
Dmitry Timoshkov e14e6bdeed mstask: Handle disabled tasks in ITask::GetNextRunTime().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-22 10:24:52 +02:00
Dmitry Timoshkov 5443f0ee2b mstask: Implement ITask::GetNextRunTime() for DAILY trigger type.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-21 16:22:18 +02:00
Dmitry Timoshkov ac322334fa mstask: Implement ITask::GetNextRunTime() for ONCE trigger type.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-21 16:22:12 +02:00
Dmitry Timoshkov 47f3dd0565 mstask: Implement ITask::GetExitCode().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-15 12:33:34 +02:00
Dmitry Timoshkov 8622493dd3 mstask: When writing triggers access the trigger data directly to avoid noise in the traces.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-15 12:33:33 +02:00
Dmitry Timoshkov 3b1e5c81f4 mstask: Move trigger management to the ITask implementation.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-14 12:11:48 +02:00
Dmitry Timoshkov bad78747f6 mstask: Implement ITask::SetFlags().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-14 12:11:48 +02:00
Dmitry Timoshkov 00261db37e mstask: Implement ITask::Terminate().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov df0fbd5c18 mstask: Implement ITask::Run().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov 87cc8cf3bb mstask: Try opening a file more times when saving a job file.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov 6a9e127097 mstask: Write more correct flags and status to the job file.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov a652d51e06 mstask: Return SCHED_S_TASK_RUNNING from ITask::GetStatus() if there are running task instances.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov 8cfdaa45bb mstask: Implement ITask::GetFlags().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov 747cd087a9 mstask: Initialize more task fields from the job file on load.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov bfb7a0aa1f mstask: Don't touch instance count field of the job file in the client.
It should be managed on the server side.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Dmitry Timoshkov e7987b1e4b 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>
2018-04-26 11:56:20 +02:00
Dmitry Timoshkov ce57e5c4d7 mstask: Correctly initialize trigger count when loading a task.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 11:56:17 +02:00
Dmitry Timoshkov 8d7d858d2b mstask: Improve ITask::GetNextRunTime() stub.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 11:56:13 +02:00
Dmitry Timoshkov c3a30bcfb9 mstask: Add dirty flag management.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 11:55:40 +02:00
Dmitry Timoshkov 37ae95dfd9 mstask: Forward IPersistFile::AddRef()/Release() to parent object.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 11:55:35 +02:00
Dmitry Timoshkov 98241dfa5a mstask: Switch to using heap wrappers.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 11:55:31 +02:00
Dmitry Timoshkov 71c264526f mstask: Return S_OK from ITask::SetFlags().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-25 10:51:04 +02:00
Dmitry Timoshkov 114f86e74e mstask: Implement IPersistFile::Load().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-25 10:51:01 +02:00
Dmitry Timoshkov ce0d9956f5 mstask: Implement IPersistFile::GetCurFile().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-25 10:49:57 +02:00
Dmitry Timoshkov 0ad429aff6 mstask: Implement ITask::GetTrigger().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:42 +02:00
Dmitry Timoshkov 0049deca7a mstask: Implement ITask::DeleteTrigger().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:39 +02:00
Dmitry Timoshkov bcb50e2d12 mstask: Implement ITask::CreateTrigger().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:35 +02:00
Dmitry Timoshkov 90160bd65d mstask: Implement ITask::GetTriggerCount().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:32 +02:00
Dmitry Timoshkov bdb78491cb mstask: Fix saving the triggers.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:28 +02:00
Dmitry Timoshkov f997b16230 mstask: Initialize task file name in the task constructor.
IPersistFile::Save() receives full path name.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:25 +02:00
Dmitry Timoshkov 66d8e7f6a9 mstask: Save a task with at least 1 trigger to follow the .job file spec.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 10:33:17 +02:00
Dmitry Timoshkov e4b7334574 mstask: Implement IPersistFile::Save().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-20 14:10:25 +02:00
Dmitry Timoshkov be8a21f136 mstask: Implement better stub for ITask::GetMostRecentRunTime().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-20 14:09:19 +02:00
Dmitry Timoshkov 23be14b1af mstask: Implement better stub for ITask::GetExitCode().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-20 14:09:13 +02:00