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
a3566fd6
Commit
a3566fd6
authored
Jun 06, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Read triggers when loading a job file.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
756bbb5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
25 deletions
+36
-25
atsvc.c
dlls/schedsvc/atsvc.c
+36
-25
No files found.
dlls/schedsvc/atsvc.c
View file @
a3566fd6
...
...
@@ -64,6 +64,8 @@ struct job_t
AT_ENUM
info
;
FIXDLEN_DATA
data
;
USHORT
instance_count
;
USHORT
trigger_count
;
TASK_TRIGGER
*
trigger
;
};
struct
running_job_t
...
...
@@ -143,7 +145,7 @@ 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
triggers_count
,
i
;
USHORT
i
;
const
USHORT
*
signature
;
const
TASK_TRIGGER
*
trigger
;
...
...
@@ -202,11 +204,10 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
TRACE
(
"no space for triggers count
\n
"
);
return
FALSE
;
}
triggers
_count
=
*
(
const
USHORT
*
)(
data
+
fixed
->
trigger_offset
);
TRACE
(
"trigger
s_count %u
\n
"
,
triggers
_count
);
info
->
trigger
_count
=
*
(
const
USHORT
*
)(
data
+
fixed
->
trigger_offset
);
TRACE
(
"trigger
_count %u
\n
"
,
info
->
trigger
_count
);
triggers_size
=
size
-
fixed
->
trigger_offset
-
sizeof
(
USHORT
);
TRACE
(
"triggers_size %u
\n
"
,
triggers_size
);
trigger
=
(
const
TASK_TRIGGER
*
)(
data
+
fixed
->
trigger_offset
+
sizeof
(
USHORT
));
data
+=
fixed
->
name_size_offset
+
unicode_strings_size
;
size
-=
fixed
->
name_size_offset
+
unicode_strings_size
;
...
...
@@ -249,42 +250,51 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
/* Trigger Data */
TRACE
(
"trigger_offset %04x, triggers end at %04x
\n
"
,
fixed
->
trigger_offset
,
(
DWORD
)(
fixed
->
trigger_offset
+
sizeof
(
USHORT
)
+
triggers
_count
*
sizeof
(
TASK_TRIGGER
)));
(
DWORD
)(
fixed
->
trigger_offset
+
sizeof
(
USHORT
)
+
info
->
trigger
_count
*
sizeof
(
TASK_TRIGGER
)));
triggers
_count
=
*
(
const
USHORT
*
)
data
;
TRACE
(
"trigger
s_count %u
\n
"
,
triggers
_count
);
info
->
trigger
_count
=
*
(
const
USHORT
*
)
data
;
TRACE
(
"trigger
_count %u
\n
"
,
info
->
trigger
_count
);
trigger
=
(
const
TASK_TRIGGER
*
)(
data
+
sizeof
(
USHORT
));
if
(
triggers
_count
*
sizeof
(
TASK_TRIGGER
)
>
triggers_size
)
if
(
info
->
trigger
_count
*
sizeof
(
TASK_TRIGGER
)
>
triggers_size
)
{
TRACE
(
"no space for triggers data
\n
"
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
triggers_count
;
i
++
)
info
->
trigger
=
heap_alloc
(
info
->
trigger_count
*
sizeof
(
info
->
trigger
[
0
]));
if
(
!
info
->
trigger
)
{
TRACE
(
"not enough memory for trigger data
\n
"
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
info
->
trigger_count
;
i
++
)
{
TRACE
(
"%u: cbTriggerSize = %#x
\n
"
,
i
,
trigger
[
i
].
cbTriggerSize
);
if
(
trigger
[
i
].
cbTriggerSize
!=
sizeof
(
TASK_TRIGGER
))
TRACE
(
"invalid cbTriggerSize
\n
"
);
TRACE
(
"Reserved1 = %#x
\n
"
,
trigger
[
i
].
Reserved1
);
TRACE
(
"wBeginYear = %u
\n
"
,
trigger
->
wBeginYear
);
TRACE
(
"wBeginMonth = %u
\n
"
,
trigger
->
wBeginMonth
);
TRACE
(
"wBeginDay = %u
\n
"
,
trigger
->
wBeginDay
);
TRACE
(
"wEndYear = %u
\n
"
,
trigger
->
wEndYear
);
TRACE
(
"wEndMonth = %u
\n
"
,
trigger
->
wEndMonth
);
TRACE
(
"wEndDay = %u
\n
"
,
trigger
->
wEndDay
);
TRACE
(
"wStartHour = %u
\n
"
,
trigger
->
wStartHour
);
TRACE
(
"wStartMinute = %u
\n
"
,
trigger
->
wStartMinute
);
TRACE
(
"MinutesDuration = %u
\n
"
,
trigger
->
MinutesDuration
);
TRACE
(
"MinutesInterval = %u
\n
"
,
trigger
->
MinutesInterval
);
TRACE
(
"rgFlags = %u
\n
"
,
trigger
->
rgFlags
);
TRACE
(
"TriggerType = %u
\n
"
,
trigger
->
TriggerType
);
TRACE
(
"Reserved2 = %u
\n
"
,
trigger
->
Reserved2
);
TRACE
(
"wRandomMinutesInterval = %u
\n
"
,
trigger
->
wRandomMinutesInterval
);
TRACE
(
"wBeginYear = %u
\n
"
,
trigger
[
i
].
wBeginYear
);
TRACE
(
"wBeginMonth = %u
\n
"
,
trigger
[
i
].
wBeginMonth
);
TRACE
(
"wBeginDay = %u
\n
"
,
trigger
[
i
].
wBeginDay
);
TRACE
(
"wEndYear = %u
\n
"
,
trigger
[
i
].
wEndYear
);
TRACE
(
"wEndMonth = %u
\n
"
,
trigger
[
i
].
wEndMonth
);
TRACE
(
"wEndDay = %u
\n
"
,
trigger
[
i
].
wEndDay
);
TRACE
(
"wStartHour = %u
\n
"
,
trigger
[
i
].
wStartHour
);
TRACE
(
"wStartMinute = %u
\n
"
,
trigger
[
i
].
wStartMinute
);
TRACE
(
"MinutesDuration = %u
\n
"
,
trigger
[
i
].
MinutesDuration
);
TRACE
(
"MinutesInterval = %u
\n
"
,
trigger
[
i
].
MinutesInterval
);
TRACE
(
"rgFlags = %u
\n
"
,
trigger
[
i
].
rgFlags
);
TRACE
(
"TriggerType = %u
\n
"
,
trigger
[
i
].
TriggerType
);
TRACE
(
"Reserved2 = %u
\n
"
,
trigger
[
i
].
Reserved2
);
TRACE
(
"wRandomMinutesInterval = %u
\n
"
,
trigger
[
i
].
wRandomMinutesInterval
);
info
->
trigger
[
i
]
=
trigger
[
i
];
}
size
-=
sizeof
(
USHORT
)
+
triggers
_count
*
sizeof
(
TASK_TRIGGER
);
data
+=
sizeof
(
USHORT
)
+
triggers
_count
*
sizeof
(
TASK_TRIGGER
);
size
-=
sizeof
(
USHORT
)
+
info
->
trigger
_count
*
sizeof
(
TASK_TRIGGER
);
data
+=
sizeof
(
USHORT
)
+
info
->
trigger
_count
*
sizeof
(
TASK_TRIGGER
);
if
(
size
<
2
*
sizeof
(
USHORT
)
+
64
)
{
...
...
@@ -353,6 +363,7 @@ static void free_job(struct job_t *job)
heap_free
(
job
->
name
);
heap_free
(
job
->
params
);
heap_free
(
job
->
curdir
);
heap_free
(
job
->
trigger
);
heap_free
(
job
);
}
...
...
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