winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
716 discussions
Start a n
N
ew thread
Dmitry Timoshkov : schedsvc: Read more task fields from the job file.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: a66c6a09685f3d6c51fe2a3c010309d7c34e55eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a66c6a09685f3d6c51fe2a3c…
Author: Dmitry Timoshkov <dmitry(a)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(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)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++;
1
0
0
0
Dmitry Timoshkov : mstask/tests: Add some tests for ITask::Run().
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 3310cd5385f76a9be95a04c6ea98b608657d7961 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3310cd5385f76a9be95a04c6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:47 2018 +0800 mstask/tests: Add some tests for ITask::Run(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/tests/task.c | 164 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index 6837782..2e8ee93 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -591,6 +591,169 @@ static void test_task_state(void) cleanup_task(); } +static void save_job(ITask *task) +{ + HRESULT hr; + IPersistFile *pfile; + + hr = ITask_QueryInterface(task, &IID_IPersistFile, (void **)&pfile); + ok(hr == S_OK, "QueryInterface error %#x\n", hr); + + hr = IPersistFile_Save(pfile, NULL, FALSE); + ok(hr == S_OK, "got %#x\n", hr); + + IPersistFile_Release(pfile); +} + +static void test_Run(void) +{ + static const WCHAR wine_test_runW[] = { 'w','i','n','e','_','t','e','s','t','_','r','u','n',0 }; + static const WCHAR cmdW[] = { 'c','m','d','.','e','x','e',0 }; + ITaskScheduler *scheduler; + ITask *task; + ITaskTrigger *trigger; + WORD idx, i; + TASK_TRIGGER trigger_data; + SYSTEMTIME st; + HRESULT hr, status; + + hr = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **)&scheduler); + ok(hr == S_OK, "got %#x\n", hr); + + /* cleanup after previous runs */ + ITaskScheduler_Delete(scheduler, wine_test_runW); + + hr = ITaskScheduler_NewWorkItem(scheduler, wine_test_runW, &CLSID_CTask, + &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "got %#x\n", hr); + + hr = ITask_Run(task); + ok(hr == SCHED_E_TASK_NOT_READY, "got %#x\n", hr); + + hr = ITask_Terminate(task); + ok(hr == SCHED_E_TASK_NOT_RUNNING, "got %#x\n", hr); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(status == SCHED_S_TASK_NOT_SCHEDULED, "got %#x\n", status); + + save_job(task); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(status == SCHED_S_TASK_NOT_SCHEDULED, "got %#x\n", status); + + hr = ITask_CreateTrigger(task, &idx, &trigger); + ok(hr == S_OK, "got %#x\n", hr); + + memset(&trigger_data, 0, sizeof(trigger_data)); + trigger_data.cbTriggerSize = sizeof(trigger_data); + trigger_data.Reserved1 = 0; + GetLocalTime(&st); + trigger_data.wBeginYear = st.wYear; + trigger_data.wBeginMonth = st.wMonth; + trigger_data.wBeginDay = st.wDay; + trigger_data.wStartHour = st.wHour; + trigger_data.wStartMinute = st.wMinute; + trigger_data.TriggerType = TASK_TIME_TRIGGER_WEEKLY; + trigger_data.Type.Weekly.WeeksInterval = 1; + trigger_data.Type.Weekly.rgfDaysOfTheWeek = 0x7f; /* every day */ + hr = ITaskTrigger_SetTrigger(trigger, &trigger_data); + ok(hr == S_OK, "got %#x\n", hr); + ITaskTrigger_Release(trigger); + + hr = ITask_SetApplicationName(task, cmdW); + ok(hr == S_OK, "got %#x\n", hr); + + hr = ITask_SetParameters(task, empty); + ok(hr == S_OK, "got %#x\n", hr); + + hr = ITask_SetWorkingDirectory(task, empty); + ok(hr == S_OK, "got %#x\n", hr); + + /* Save the task so that the Scheduler service would notice the changes */ + save_job(task); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(status == SCHED_S_TASK_HAS_NOT_RUN, "got %#x\n", status); + + hr = ITask_Run(task); + ok(hr == S_OK, "got %#x\n", hr); + + /* According to MSDN the task status doesn't update dynamically */ + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(status == SCHED_S_TASK_HAS_NOT_RUN, "got %#x\n", status); + + ITask_Release(task); + + /* Running the process associated with the task to start up may + * take quite a bit a of time, and waiting for it during the test + * may be not the best idea. + * + * This is how it's supposed to look like in the application + * (the loop should be infinite): + */ + for (i = 0; i < 3; i++) + { + hr = ITaskScheduler_Activate(scheduler, wine_test_runW, &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "Activate error %#x\n", hr); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + + ITask_Release(task); + + if (status == SCHED_S_TASK_RUNNING) break; + + Sleep(100); + } + + hr = ITaskScheduler_Activate(scheduler, wine_test_runW, &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "Activate error %#x\n", hr); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + + if (status == SCHED_S_TASK_RUNNING) + { + hr = ITask_Terminate(task); + ok(hr == S_OK, "got %#x\n", hr); + + ITask_Release(task); + + /* Waiting for the process associated with the task to terminate + * may take quite a bit a of time, and waiting for it during the + * test is not practical. + * + * This is how it's supposed to look like in the application + * (the loop should be infinite): + */ + for (i = 0; i < 3; i++) + { + hr = ITaskScheduler_Activate(scheduler, wine_test_runW, &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "Activate error %#x\n", hr); + + hr = ITask_GetStatus(task, &status); + ok(hr == S_OK, "got %#x\n", hr); + + ITask_Release(task); + + if (status != SCHED_S_TASK_RUNNING) break; + + Sleep(100); + } + } + else + ITask_Release(task); + + hr = ITaskScheduler_Delete(scheduler, wine_test_runW); + ok(hr == S_OK, "got %#x\n", hr); + ITaskScheduler_Release(scheduler); +} + START_TEST(task) { CoInitialize(NULL); @@ -601,5 +764,6 @@ START_TEST(task) test_SetMaxRunTime_GetMaxRunTime(); test_SetAccountInformation_GetAccountInformation(); test_task_state(); + test_Run(); CoUninitialize(); }
1
0
0
0
Dmitry Timoshkov : mstask: Implement ITask::Terminate().
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 00261db37e5157f4328bb137b91b80da6e0a1e75 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=00261db37e5157f4328bb137…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:45 2018 +0800 mstask: Implement ITask::Terminate(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index fa84f4e..9cdf92e 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -283,11 +283,17 @@ static HRESULT WINAPI MSTASK_ITask_Run(ITask *iface) return IPersistFile_Save(&This->IPersistFile_iface, NULL, FALSE); } -static HRESULT WINAPI MSTASK_ITask_Terminate( - ITask* iface) +static HRESULT WINAPI MSTASK_ITask_Terminate(ITask *iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + TaskImpl *This = impl_from_ITask(iface); + + TRACE("(%p)\n", iface); + + if (!This->instance_count) + return SCHED_E_TASK_NOT_RUNNING; + + This->flags |= 0x08000000; + return IPersistFile_Save(&This->IPersistFile_iface, NULL, FALSE); } static HRESULT WINAPI MSTASK_ITask_EditWorkItem(
1
0
0
0
Dmitry Timoshkov : mstask: Implement ITask::Run().
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: df0fbd5c18de40c69b9095b681456cee59618140 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df0fbd5c18de40c69b9095b6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:43 2018 +0800 mstask: Implement ITask::Run(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 82ba96e..fa84f4e 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -270,11 +270,17 @@ static HRESULT WINAPI MSTASK_ITask_GetIdleWait(ITask *iface, WORD *idle_minutes, return S_OK; } -static HRESULT WINAPI MSTASK_ITask_Run( - ITask* iface) +static HRESULT WINAPI MSTASK_ITask_Run(ITask *iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + TaskImpl *This = impl_from_ITask(iface); + + TRACE("(%p)\n", iface); + + if (This->status == SCHED_S_TASK_NOT_SCHEDULED) + return SCHED_E_TASK_NOT_READY; + + This->flags |= 0x04000000; + return IPersistFile_Save(&This->IPersistFile_iface, NULL, FALSE); } static HRESULT WINAPI MSTASK_ITask_Terminate(
1
0
0
0
Dmitry Timoshkov : mstask: Try opening a file more times when saving a job file.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 87cc8cf3bb56f9fb954bc964325b4b438ca742d2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=87cc8cf3bb56f9fb954bc964…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:41 2018 +0800 mstask: Try opening a file more times when saving a job file. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index a5dd603..82ba96e 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -1195,7 +1195,7 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta FIXDLEN_DATA fixed; WORD word, user_data_size = 0; HANDLE hfile; - DWORD size, ver, disposition; + DWORD size, ver, disposition, try; TaskImpl *This = impl_from_IPersistFile(iface); ITask *task = &This->ITask_iface; LPWSTR appname = NULL, params = NULL, workdir = NULL, creator = NULL, comment = NULL; @@ -1258,9 +1258,15 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta fixed.flags = This->flags; memset(&fixed.last_runtime, 0, sizeof(fixed.last_runtime)); - hfile = CreateFileW(task_name, GENERIC_WRITE, 0, NULL, disposition, 0, 0); - if (hfile == INVALID_HANDLE_VALUE) - return HRESULT_FROM_WIN32(GetLastError()); + try = 1; + for (;;) + { + hfile = CreateFileW(task_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, disposition, 0, 0); + if (hfile != INVALID_HANDLE_VALUE) break; + + if (try++ >= 3) return HRESULT_FROM_WIN32(GetLastError()); + Sleep(100); + } if (!WriteFile(hfile, &fixed, sizeof(fixed), &size, NULL)) {
1
0
0
0
Dmitry Timoshkov : mstask: Write more correct flags and status to the job file.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 6a9e12709714d8ef68f3adb7a840a8091f86a319 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6a9e12709714d8ef68f3adb7…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:39 2018 +0800 mstask: Write more correct flags and status to the job file. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index aa50620..a5dd603 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -1252,8 +1252,10 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta fixed.priority = This->priority; fixed.maximum_runtime = This->maxRunTime; fixed.exit_code = 0; - fixed.status = SCHED_S_TASK_HAS_NOT_RUN; - fixed.flags = 0; + if (This->status == SCHED_S_TASK_NOT_SCHEDULED && This->trigger_count) + This->status = SCHED_S_TASK_HAS_NOT_RUN; + fixed.status = This->status; + fixed.flags = This->flags; memset(&fixed.last_runtime, 0, sizeof(fixed.last_runtime)); hfile = CreateFileW(task_name, GENERIC_WRITE, 0, NULL, disposition, 0, 0);
1
0
0
0
Dmitry Timoshkov : mstask: Return SCHED_S_TASK_RUNNING from ITask:: GetStatus() if there are running task instances.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: a652d51e06d2b11870686296b5c3dcadf9f3acac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a652d51e06d2b11870686296…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:36 2018 +0800 mstask: Return SCHED_S_TASK_RUNNING from ITask::GetStatus() if there are running task instances. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 47ed4cb..aa50620 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -307,7 +307,7 @@ static HRESULT WINAPI MSTASK_ITask_GetStatus(ITask *iface, HRESULT *status) TRACE("(%p, %p)\n", iface, status); - *status = This->status; + *status = This->instance_count ? SCHED_S_TASK_RUNNING : This->status; return S_OK; }
1
0
0
0
Dmitry Timoshkov : mstask: Implement ITask::GetFlags().
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 8cfdaa45bb4f16a122dea40920a05bf29308843e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8cfdaa45bb4f16a122dea409…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:34 2018 +0800 mstask: Implement ITask::GetFlags(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index c99d51f..47ed4cb 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -489,8 +489,10 @@ static HRESULT WINAPI MSTASK_ITask_SetFlags( static HRESULT WINAPI MSTASK_ITask_GetFlags(ITask *iface, DWORD *flags) { - FIXME("(%p, %p): stub\n", iface, flags); - *flags = 0; + TaskImpl *This = impl_from_ITask(iface); + + TRACE("(%p, %p)\n", iface, flags); + *flags = LOWORD(This->flags); return S_OK; }
1
0
0
0
Dmitry Timoshkov : mstask: Initialize more task fields from the job file on load.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: 747cd087a90243c99d52058d798f03c79d9e1f5e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=747cd087a90243c99d52058d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:31 2018 +0800 mstask: Initialize more task fields from the job file on load. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 5ec7064..c99d51f 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -58,6 +58,7 @@ typedef struct ITaskDefinition *task; IExecAction *action; LPWSTR task_name; + UINT flags; HRESULT status; WORD idle_minutes, deadline_minutes; DWORD priority, maxRunTime; @@ -65,6 +66,7 @@ typedef struct DWORD trigger_count; TASK_TRIGGER *trigger; BOOL is_dirty; + USHORT instance_count; } TaskImpl; static inline TaskImpl *impl_from_ITask(ITask *iface) @@ -855,7 +857,7 @@ static HRESULT load_job_data(TaskImpl *This, BYTE *data, DWORD size) const FIXDLEN_DATA *fixed; const SYSTEMTIME *st; DWORD unicode_strings_size, data_size, triggers_size; - USHORT instance_count, trigger_count, i; + USHORT trigger_count, i; const USHORT *signature; TASK_TRIGGER *task_trigger; @@ -888,7 +890,9 @@ static HRESULT load_job_data(TaskImpl *This, BYTE *data, DWORD size) This->maxRunTime = fixed->maximum_runtime; TRACE("exit_code %#x\n", fixed->exit_code); TRACE("status %08x\n", fixed->status); + This->status = fixed->status; TRACE("flags %08x\n", fixed->flags); + This->flags = fixed->flags; st = &fixed->last_runtime; TRACE("last_runtime %d/%d/%d wday %d %d:%d:%d.%03d\n", st->wDay, st->wMonth, st->wYear, st->wDayOfWeek, @@ -901,8 +905,8 @@ static HRESULT load_job_data(TaskImpl *This, BYTE *data, DWORD size) return SCHED_E_INVALID_TASK; } - instance_count = *(const USHORT *)(data + sizeof(*fixed)); - TRACE("instance count %u\n", instance_count); + This->instance_count = *(const USHORT *)(data + sizeof(*fixed)); + TRACE("instance count %u\n", This->instance_count); if (fixed->name_size_offset + sizeof(USHORT) < size) unicode_strings_size = load_unicode_strings(task, data + fixed->name_size_offset, size - fixed->name_size_offset); @@ -1463,6 +1467,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *name, ITask **task) This->ref = 1; This->task = taskdef; This->task_name = heap_strdupW(task_name); + This->flags = 0; This->status = SCHED_S_TASK_NOT_SCHEDULED; This->idle_minutes = 10; This->deadline_minutes = 60; @@ -1471,6 +1476,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *name, ITask **task) This->trigger_count = 0; This->trigger = NULL; This->is_dirty = FALSE; + This->instance_count = 0; /* Default time is 3 days = 259200000 ms */ This->maxRunTime = 259200000;
1
0
0
0
Dmitry Timoshkov : mstask: Don' t touch instance count field of the job file in the client.
by Alexandre Julliard
11 May '18
11 May '18
Module: wine Branch: master Commit: bfb7a0aa1fbf856a479e22311e0855380674edf5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bfb7a0aa1fbf856a479e2231…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri May 11 12:36:28 2018 +0800 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(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/task.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 986faa1..5ec7064 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -1260,9 +1260,8 @@ static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR ta goto failed; } - /* Instance Count */ - word = 0; - if (!WriteFile(hfile, &word, sizeof(word), &size, NULL)) + /* Instance Count: don't touch it in the client */ + if (SetFilePointer(hfile, sizeof(word), NULL, FILE_CURRENT) == INVALID_SET_FILE_POINTER) { hr = HRESULT_FROM_WIN32(GetLastError()); goto failed;
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200