Commit 9823191a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

schedsvc: Reimplement FILE_ACTION_MODIFIED by remove_job()/add_job() sequence as MSDN suggests.

parent 31fa7454
...@@ -546,27 +546,6 @@ void remove_job(const WCHAR *name) ...@@ -546,27 +546,6 @@ void remove_job(const WCHAR *name)
LeaveCriticalSection(&at_job_list_section); LeaveCriticalSection(&at_job_list_section);
} }
void modify_job(const WCHAR *name)
{
AT_ENUM info;
if (load_job(name, &info))
{
struct job_t *job;
EnterCriticalSection(&at_job_list_section);
job = find_job(0, name);
if (job)
{
free_job_info(&job->info);
job->info = info;
}
else
free_job_info(&info);
LeaveCriticalSection(&at_job_list_section);
}
}
DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid) DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid)
{ {
WCHAR windir[MAX_PATH]; WCHAR windir[MAX_PATH];
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
void schedsvc_auto_start(void) DECLSPEC_HIDDEN; void schedsvc_auto_start(void) DECLSPEC_HIDDEN;
void add_job(const WCHAR *name) DECLSPEC_HIDDEN; void add_job(const WCHAR *name) DECLSPEC_HIDDEN;
void remove_job(const WCHAR *name) DECLSPEC_HIDDEN; void remove_job(const WCHAR *name) DECLSPEC_HIDDEN;
void modify_job(const WCHAR *name) DECLSPEC_HIDDEN;
static inline WCHAR *heap_strdupW(const WCHAR *src) static inline WCHAR *heap_strdupW(const WCHAR *src)
{ {
......
...@@ -118,7 +118,8 @@ static DWORD WINAPI tasks_monitor_thread(void *arg) ...@@ -118,7 +118,8 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
GetWindowsDirectoryW(path, MAX_PATH); GetWindowsDirectoryW(path, MAX_PATH);
lstrcatW(path, tasksW); lstrcatW(path, tasksW);
lstrcatW(path, info.data.FileName); lstrcatW(path, info.data.FileName);
modify_job(path); remove_job(info.data.FileName);
add_job(info.data.FileName);
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment