Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
65d98714
Commit
65d98714
authored
Aug 22, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Aug 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implemented (Set|Get)Trigger.
parent
7c5f411e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
5 deletions
+181
-5
Makefile.in
dlls/mstask/Makefile.in
+1
-1
mstask_private.h
dlls/mstask/mstask_private.h
+1
-0
task_trigger.c
dlls/mstask/task_trigger.c
+179
-4
task_trigger.c
dlls/mstask/tests/task_trigger.c
+0
-0
No files found.
dlls/mstask/Makefile.in
View file @
65d98714
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
mstask.dll
IMPORTS
=
uuid ole32 kernel32
IMPORTS
=
uuid ole32 kernel32
ntdll
C_SRCS
=
\
factory.c
\
...
...
dlls/mstask/mstask_private.h
View file @
65d98714
...
...
@@ -42,6 +42,7 @@ typedef struct
{
const
ITaskTriggerVtbl
*
lpVtbl
;
LONG
ref
;
TASK_TRIGGER
triggerCond
;
}
TaskTriggerImpl
;
extern
HRESULT
TaskTriggerConstructor
(
LPVOID
*
ppObj
);
...
...
dlls/mstask/task_trigger.c
View file @
65d98714
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "winternl.h"
#include "mstask_private.h"
#include "wine/debug.h"
...
...
@@ -74,16 +76,174 @@ static HRESULT WINAPI MSTASK_ITaskTrigger_SetTrigger(
ITaskTrigger
*
iface
,
const
PTASK_TRIGGER
pTrigger
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
TaskTriggerImpl
*
This
=
(
TaskTriggerImpl
*
)
iface
;
TIME_FIELDS
field_time
;
LARGE_INTEGER
sys_time
;
TASK_TRIGGER
tmp_trigger_cond
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pTrigger
);
/* Verify valid structure size */
if
(
pTrigger
->
cbTriggerSize
!=
sizeof
(
*
pTrigger
))
return
E_INVALIDARG
;
tmp_trigger_cond
.
cbTriggerSize
=
pTrigger
->
cbTriggerSize
;
/* Reserved field must be zero */
tmp_trigger_cond
.
Reserved1
=
0
;
/* Verify and set valid start date and time */
memset
(
&
field_time
,
0
,
sizeof
(
field_time
));
field_time
.
Year
=
pTrigger
->
wBeginYear
;
field_time
.
Month
=
pTrigger
->
wBeginMonth
;
field_time
.
Day
=
pTrigger
->
wBeginDay
;
field_time
.
Hour
=
pTrigger
->
wStartHour
;
field_time
.
Minute
=
pTrigger
->
wStartMinute
;
if
(
!
RtlTimeFieldsToTime
(
&
field_time
,
&
sys_time
))
return
E_INVALIDARG
;
tmp_trigger_cond
.
wBeginYear
=
pTrigger
->
wBeginYear
;
tmp_trigger_cond
.
wBeginMonth
=
pTrigger
->
wBeginMonth
;
tmp_trigger_cond
.
wBeginDay
=
pTrigger
->
wBeginDay
;
tmp_trigger_cond
.
wStartHour
=
pTrigger
->
wStartHour
;
tmp_trigger_cond
.
wStartMinute
=
pTrigger
->
wStartMinute
;
/* Verify valid end date if TASK_TRIGGER_FLAG_HAS_END_DATE flag is set */
if
(
pTrigger
->
rgFlags
&
TASK_TRIGGER_FLAG_HAS_END_DATE
)
{
memset
(
&
field_time
,
0
,
sizeof
(
field_time
));
field_time
.
Year
=
pTrigger
->
wEndYear
;
field_time
.
Month
=
pTrigger
->
wEndMonth
;
field_time
.
Day
=
pTrigger
->
wEndDay
;
if
(
!
RtlTimeFieldsToTime
(
&
field_time
,
&
sys_time
))
return
E_INVALIDARG
;
}
/* Set valid end date independent of TASK_TRIGGER_FLAG_HAS_END_DATE flag */
tmp_trigger_cond
.
wEndYear
=
pTrigger
->
wEndYear
;
tmp_trigger_cond
.
wEndMonth
=
pTrigger
->
wEndMonth
;
tmp_trigger_cond
.
wEndDay
=
pTrigger
->
wEndDay
;
/* Verify duration and interval pair */
if
(
pTrigger
->
MinutesDuration
<=
pTrigger
->
MinutesInterval
&&
pTrigger
->
MinutesInterval
>
0
)
return
E_INVALIDARG
;
if
(
pTrigger
->
MinutesDuration
>
0
&&
pTrigger
->
MinutesInterval
==
0
)
return
E_INVALIDARG
;
tmp_trigger_cond
.
MinutesDuration
=
pTrigger
->
MinutesDuration
;
tmp_trigger_cond
.
MinutesInterval
=
pTrigger
->
MinutesInterval
;
/* Copy over flags */
tmp_trigger_cond
.
rgFlags
=
pTrigger
->
rgFlags
;
/* Set TriggerType dependent fields of Type union */
tmp_trigger_cond
.
TriggerType
=
pTrigger
->
TriggerType
;
switch
(
pTrigger
->
TriggerType
)
{
case
TASK_TIME_TRIGGER_DAILY
:
tmp_trigger_cond
.
Type
.
Daily
.
DaysInterval
=
pTrigger
->
Type
.
Daily
.
DaysInterval
;
break
;
case
TASK_TIME_TRIGGER_WEEKLY
:
tmp_trigger_cond
.
Type
.
Weekly
.
WeeksInterval
=
pTrigger
->
Type
.
Weekly
.
WeeksInterval
;
tmp_trigger_cond
.
Type
.
Weekly
.
rgfDaysOfTheWeek
=
pTrigger
->
Type
.
Weekly
.
rgfDaysOfTheWeek
;
break
;
case
TASK_TIME_TRIGGER_MONTHLYDATE
:
tmp_trigger_cond
.
Type
.
MonthlyDate
.
rgfDays
=
pTrigger
->
Type
.
MonthlyDate
.
rgfDays
;
tmp_trigger_cond
.
Type
.
MonthlyDate
.
rgfMonths
=
pTrigger
->
Type
.
MonthlyDate
.
rgfMonths
;
break
;
case
TASK_TIME_TRIGGER_MONTHLYDOW
:
tmp_trigger_cond
.
Type
.
MonthlyDOW
.
wWhichWeek
=
pTrigger
->
Type
.
MonthlyDOW
.
wWhichWeek
;
tmp_trigger_cond
.
Type
.
MonthlyDOW
.
rgfDaysOfTheWeek
=
pTrigger
->
Type
.
MonthlyDOW
.
rgfDaysOfTheWeek
;
tmp_trigger_cond
.
Type
.
MonthlyDOW
.
rgfMonths
=
pTrigger
->
Type
.
MonthlyDOW
.
rgfMonths
;
break
;
case
TASK_TIME_TRIGGER_ONCE
:
case
TASK_EVENT_TRIGGER_ON_IDLE
:
case
TASK_EVENT_TRIGGER_AT_SYSTEMSTART
:
case
TASK_EVENT_TRIGGER_AT_LOGON
:
default:
tmp_trigger_cond
.
Type
=
This
->
triggerCond
.
Type
;
break
;
}
/* Reserved field must be zero */
tmp_trigger_cond
.
Reserved2
=
0
;
/* wRandomMinutesInterval not currently used and is initialized to zero */
tmp_trigger_cond
.
wRandomMinutesInterval
=
0
;
/* Update object copy of triggerCond */
This
->
triggerCond
=
tmp_trigger_cond
;
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITaskTrigger_GetTrigger
(
ITaskTrigger
*
iface
,
PTASK_TRIGGER
pTrigger
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
TaskTriggerImpl
*
This
=
(
TaskTriggerImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pTrigger
);
/* Native implementation doesn't verify equivalent cbTriggerSize fields */
/* Copy relevant fields of the structure */
pTrigger
->
cbTriggerSize
=
This
->
triggerCond
.
cbTriggerSize
;
pTrigger
->
Reserved1
=
0
;
pTrigger
->
wBeginYear
=
This
->
triggerCond
.
wBeginYear
;
pTrigger
->
wBeginMonth
=
This
->
triggerCond
.
wBeginMonth
;
pTrigger
->
wBeginDay
=
This
->
triggerCond
.
wBeginDay
;
pTrigger
->
wEndYear
=
This
->
triggerCond
.
wEndYear
;
pTrigger
->
wEndMonth
=
This
->
triggerCond
.
wEndMonth
;
pTrigger
->
wEndDay
=
This
->
triggerCond
.
wEndDay
;
pTrigger
->
wStartHour
=
This
->
triggerCond
.
wStartHour
;
pTrigger
->
wStartMinute
=
This
->
triggerCond
.
wStartMinute
;
pTrigger
->
MinutesDuration
=
This
->
triggerCond
.
MinutesDuration
;
pTrigger
->
MinutesInterval
=
This
->
triggerCond
.
MinutesInterval
;
pTrigger
->
rgFlags
=
This
->
triggerCond
.
rgFlags
;
pTrigger
->
TriggerType
=
This
->
triggerCond
.
TriggerType
;
switch
(
This
->
triggerCond
.
TriggerType
)
{
case
TASK_TIME_TRIGGER_DAILY
:
pTrigger
->
Type
.
Daily
.
DaysInterval
=
This
->
triggerCond
.
Type
.
Daily
.
DaysInterval
;
break
;
case
TASK_TIME_TRIGGER_WEEKLY
:
pTrigger
->
Type
.
Weekly
.
WeeksInterval
=
This
->
triggerCond
.
Type
.
Weekly
.
WeeksInterval
;
pTrigger
->
Type
.
Weekly
.
rgfDaysOfTheWeek
=
This
->
triggerCond
.
Type
.
Weekly
.
rgfDaysOfTheWeek
;
break
;
case
TASK_TIME_TRIGGER_MONTHLYDATE
:
pTrigger
->
Type
.
MonthlyDate
.
rgfDays
=
This
->
triggerCond
.
Type
.
MonthlyDate
.
rgfDays
;
pTrigger
->
Type
.
MonthlyDate
.
rgfMonths
=
This
->
triggerCond
.
Type
.
MonthlyDate
.
rgfMonths
;
break
;
case
TASK_TIME_TRIGGER_MONTHLYDOW
:
pTrigger
->
Type
.
MonthlyDOW
.
wWhichWeek
=
This
->
triggerCond
.
Type
.
MonthlyDOW
.
wWhichWeek
;
pTrigger
->
Type
.
MonthlyDOW
.
rgfDaysOfTheWeek
=
This
->
triggerCond
.
Type
.
MonthlyDOW
.
rgfDaysOfTheWeek
;
pTrigger
->
Type
.
MonthlyDOW
.
rgfMonths
=
This
->
triggerCond
.
Type
.
MonthlyDOW
.
rgfMonths
;
break
;
case
TASK_TIME_TRIGGER_ONCE
:
case
TASK_EVENT_TRIGGER_ON_IDLE
:
case
TASK_EVENT_TRIGGER_AT_SYSTEMSTART
:
case
TASK_EVENT_TRIGGER_AT_LOGON
:
default:
break
;
}
pTrigger
->
Reserved2
=
0
;
pTrigger
->
wRandomMinutesInterval
=
0
;
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITaskTrigger_GetTriggerString
(
...
...
@@ -107,6 +267,7 @@ static const ITaskTriggerVtbl MSTASK_ITaskTriggerVtbl =
HRESULT
TaskTriggerConstructor
(
LPVOID
*
ppObj
)
{
TaskTriggerImpl
*
This
;
SYSTEMTIME
time
;
TRACE
(
"(%p)
\n
"
,
ppObj
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
...
...
@@ -116,6 +277,20 @@ HRESULT TaskTriggerConstructor(LPVOID *ppObj)
This
->
lpVtbl
=
&
MSTASK_ITaskTriggerVtbl
;
This
->
ref
=
1
;
/* Most fields of triggerCond default to zero. Initialize other
* fields to default values. */
memset
(
&
This
->
triggerCond
,
0
,
sizeof
(
TASK_TRIGGER
));
GetLocalTime
(
&
time
);
This
->
triggerCond
.
cbTriggerSize
=
sizeof
(
This
->
triggerCond
);
This
->
triggerCond
.
wBeginYear
=
time
.
wYear
;
This
->
triggerCond
.
wBeginMonth
=
time
.
wMonth
;
This
->
triggerCond
.
wBeginDay
=
time
.
wDay
;
This
->
triggerCond
.
wStartHour
=
time
.
wHour
;
This
->
triggerCond
.
wStartMinute
=
time
.
wMinute
;
This
->
triggerCond
.
rgFlags
=
TASK_TRIGGER_FLAG_DISABLED
;
This
->
triggerCond
.
TriggerType
=
TASK_TIME_TRIGGER_DAILY
,
This
->
triggerCond
.
Type
.
Daily
.
DaysInterval
=
1
;
*
ppObj
=
&
This
->
lpVtbl
;
InterlockedIncrement
(
&
dll_ref
);
return
S_OK
;
...
...
dlls/mstask/tests/task_trigger.c
View file @
65d98714
This diff is collapsed.
Click to expand it.
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