[PATCH 4/7] schedsvc: Implement NetrJobGetInfo.

Dmitry Timoshkov dmitry at baikal.ru
Tue Apr 17 02:12:10 CDT 2018


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/schedsvc/atsvc.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index 97ca75e21d..a602e4d070 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -376,6 +376,30 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
 
 DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **info)
 {
-    FIXME("%s,%u,%p: stub\n", debugstr_w(server_name), jobid, info);
-    return ERROR_NOT_SUPPORTED;
+    struct job_t *job;
+    DWORD ret = ERROR_SUCCESS;
+
+    TRACE("%s,%u,%p\n", debugstr_w(server_name), jobid, info);
+
+    EnterCriticalSection(&at_job_list_section);
+
+    job = find_job(jobid, NULL);
+    if (job)
+    {
+        AT_INFO *info_ret = heap_alloc(sizeof(*info_ret));
+        if (!info_ret)
+            ret = ERROR_NOT_ENOUGH_MEMORY;
+        else
+        {
+            info_ret->JobTime = job->info.JobTime;
+            info_ret->DaysOfMonth = job->info.DaysOfMonth;
+            info_ret->DaysOfWeek = job->info.DaysOfWeek;
+            info_ret->Flags = job->info.Flags;
+            info_ret->Command = heap_strdupW(job->info.Command);
+            *info = info_ret;
+        }
+    }
+
+    LeaveCriticalSection(&at_job_list_section);
+    return ret;
 }
-- 
2.16.3




More information about the wine-devel mailing list