Dmitry Timoshkov : schedsvc: Read more task fields from the job file.

Alexandre Julliard julliard at winehq.org
Fri May 11 13:22:27 CDT 2018


Module: wine
Branch: master
Commit: a66c6a09685f3d6c51fe2a3c010309d7c34e55eb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a66c6a09685f3d6c51fe2a3c010309d7c34e55eb

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri May 11 12:36:50 2018 +0800

schedsvc: Read more task fields from the job file.

Print a FIXME() when the service detects a client action.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/schedsvc/atsvc.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index cb9bc1f..542dfc3 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -60,6 +60,8 @@ struct job_t
     struct list entry;
     WCHAR *name;
     AT_ENUM info;
+    FIXDLEN_DATA data;
+    USHORT instance_count;
 };
 
 static LONG current_jobid = 1;
@@ -109,13 +111,12 @@ static DWORD load_unicode_strings(const char *data, DWORD limit, AT_ENUM *info)
     return data_size;
 }
 
-/* FIXME: read more data, currently only Command is handled */
-static BOOL load_job_data(const char *data, DWORD size, AT_ENUM *info)
+static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
 {
     const FIXDLEN_DATA *fixed;
     const SYSTEMTIME *st;
     DWORD unicode_strings_size, data_size, triggers_size;
-    USHORT instance_count, triggers_count, i;
+    USHORT triggers_count, i;
     const USHORT *signature;
     const TASK_TRIGGER *trigger;
 
@@ -128,6 +129,7 @@ static BOOL load_job_data(const char *data, DWORD size, AT_ENUM *info)
     }
 
     fixed = (const FIXDLEN_DATA *)data;
+    info->data = *fixed;
 
     TRACE("product_version %04x\n", fixed->product_version);
     TRACE("file_version %04x\n", fixed->file_version);
@@ -156,11 +158,11 @@ static BOOL load_job_data(const char *data, DWORD size, AT_ENUM *info)
         return FALSE;
     }
 
-    instance_count = *(const USHORT *)(data + sizeof(*fixed));
-    TRACE("instance count %u\n", instance_count);
+    info->instance_count = *(const USHORT *)(data + sizeof(*fixed));
+    TRACE("instance count %u\n", info->instance_count);
 
     if (fixed->name_size_offset + sizeof(USHORT) < size)
-        unicode_strings_size = load_unicode_strings(data + fixed->name_size_offset, size - fixed->name_size_offset, info);
+        unicode_strings_size = load_unicode_strings(data + fixed->name_size_offset, size - fixed->name_size_offset, &info->info);
     else
     {
         TRACE("invalid name_size_offset\n");
@@ -269,7 +271,7 @@ static BOOL load_job_data(const char *data, DWORD size, AT_ENUM *info)
     return TRUE;
 }
 
-static BOOL load_job(const WCHAR *name, AT_ENUM *info)
+static BOOL load_job(const WCHAR *name, struct job_t *info)
 {
     HANDLE file, mapping;
     DWORD size, try;
@@ -332,12 +334,17 @@ void add_job(const WCHAR *name)
     job = heap_alloc_zero(sizeof(*job));
     if (!job) return;
 
-    if (!load_job(name, &job->info))
+    if (!load_job(name, job))
     {
         free_job(job);
         return;
     }
 
+    if (job->data.flags & 0x08000000)
+        FIXME("Terminate(%s): not implemented\n", debugstr_w(job->info.Command));
+    else if (job->data.flags & 0x04000000)
+        FIXME("Run(%s): not implemented\n", debugstr_w(job->info.Command));
+
     EnterCriticalSection(&at_job_list_section);
     job->name = heap_strdupW(name);
     job->info.JobId = current_jobid++;




More information about the wine-cvs mailing list