Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5443f0ee
Commit
5443f0ee
authored
May 21, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implement ITask::GetNextRunTime() for DAILY trigger type.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ac322334
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
task.c
dlls/mstask/task.c
+44
-0
task_trigger.c
dlls/mstask/tests/task_trigger.c
+17
-1
No files found.
dlls/mstask/task.c
View file @
5443f0ee
...
...
@@ -445,6 +445,27 @@ static void get_end_time(const TASK_TRIGGER *trigger, FILETIME *ft)
SystemTimeToFileTime
(
&
st
,
ft
);
}
static
void
filetime_add_ms
(
FILETIME
*
ft
,
ULONGLONG
ms
)
{
union
u_ftll
{
FILETIME
ft
;
ULONGLONG
ll
;
}
*
ftll
=
(
union
u_ftll
*
)
ft
;
ftll
->
ll
+=
ms
*
(
ULONGLONG
)
10000
;
}
static
void
filetime_add_hours
(
FILETIME
*
ft
,
ULONG
hours
)
{
filetime_add_ms
(
ft
,
(
ULONGLONG
)
hours
*
60
*
60
*
1000
);
}
static
void
filetime_add_days
(
FILETIME
*
ft
,
ULONG
days
)
{
filetime_add_hours
(
ft
,
(
ULONGLONG
)
days
*
24
);
}
static
HRESULT
WINAPI
MSTASK_ITask_GetNextRunTime
(
ITask
*
iface
,
SYSTEMTIME
*
rt
)
{
TaskImpl
*
This
=
impl_from_ITask
(
iface
);
...
...
@@ -483,6 +504,29 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
}
break
;
case
TASK_TIME_TRIGGER_DAILY
:
st
=
current_st
;
st
.
wHour
=
This
->
trigger
[
i
].
wStartHour
;
st
.
wMinute
=
This
->
trigger
[
i
].
wStartMinute
;
st
.
wSecond
=
0
;
st
.
wMilliseconds
=
0
;
SystemTimeToFileTime
(
&
st
,
&
current_ft
);
while
(
CompareFileTime
(
&
current_ft
,
&
end_ft
)
<
0
)
{
if
(
CompareFileTime
(
&
current_ft
,
&
begin_ft
)
>=
0
)
{
if
(
!
have_best_time
||
CompareFileTime
(
&
current_ft
,
&
best_ft
)
<
0
)
{
best_ft
=
current_ft
;
have_best_time
=
TRUE
;
}
break
;
}
filetime_add_days
(
&
current_ft
,
This
->
trigger
[
i
].
Type
.
Daily
.
DaysInterval
);
}
break
;
default:
FIXME
(
"trigger type %u is not handled
\n
"
,
This
->
trigger
[
i
].
TriggerType
);
break
;
...
...
dlls/mstask/tests/task_trigger.c
View file @
5443f0ee
...
...
@@ -522,7 +522,23 @@ static void test_GetNextRunTime(void)
st
.
wDay
,
st
.
wMonth
,
st
.
wYear
,
st
.
wDayOfWeek
,
st
.
wHour
,
st
.
wMinute
,
st
.
wSecond
);
/* FIXME: TASK_TIME_TRIGGER_DAILY */
/* TASK_TIME_TRIGGER_DAILY */
hr
=
ITaskTrigger_GetTrigger
(
trigger
,
&
data
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
data
.
rgFlags
&=
~
TASK_TRIGGER_FLAG_DISABLED
;
data
.
TriggerType
=
TASK_TIME_TRIGGER_DAILY
;
data
.
Type
.
Daily
.
DaysInterval
=
1
;
hr
=
ITaskTrigger_SetTrigger
(
trigger
,
&
data
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
memset
(
&
st
,
0xff
,
sizeof
(
st
));
hr
=
ITask_GetNextRunTime
(
task
,
&
st
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
&
st
,
&
cmp
,
sizeof
(
st
)),
"got %u/%u/%u wday %u %u:%02u:%02u
\n
"
,
st
.
wDay
,
st
.
wMonth
,
st
.
wYear
,
st
.
wDayOfWeek
,
st
.
wHour
,
st
.
wMinute
,
st
.
wSecond
);
/* FIXME: TASK_TIME_TRIGGER_WEEKLY */
/* FIXME: TASK_TIME_TRIGGER_MONTHLYDATE */
/* FIXME: TASK_TIME_TRIGGER_MONTHLYDOW */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment