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
2eb6f886
Commit
2eb6f886
authored
Apr 17, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Add a thread for monitoring version 1 task files.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
300217e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
4 deletions
+70
-4
svc_main.c
dlls/schedsvc/svc_main.c
+69
-4
wine.inf.in
loader/wine.inf.in
+1
-0
No files found.
dlls/schedsvc/svc_main.c
View file @
2eb6f886
...
...
@@ -36,6 +36,66 @@ static const WCHAR scheduleW[] = {'S','c','h','e','d','u','l','e',0};
static
SERVICE_STATUS_HANDLE
schedsvc_handle
;
static
HANDLE
done_event
;
static
DWORD
WINAPI
tasks_monitor_thread
(
void
*
arg
)
{
static
const
WCHAR
tasksW
[]
=
{
'\\'
,
'T'
,
'a'
,
's'
,
'k'
,
's'
,
'\\'
,
0
};
WCHAR
path
[
MAX_PATH
];
HANDLE
htasks
;
OVERLAPPED
ov
;
TRACE
(
"Starting...
\n
"
);
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
lstrcatW
(
path
,
tasksW
);
htasks
=
CreateFileW
(
path
,
FILE_LIST_DIRECTORY
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
|
FILE_FLAG_OVERLAPPED
,
NULL
);
if
(
htasks
==
INVALID_HANDLE_VALUE
)
return
-
1
;
memset
(
&
ov
,
0
,
sizeof
(
ov
));
ov
.
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
for
(;;)
{
struct
{
FILE_NOTIFY_INFORMATION
data
;
WCHAR
name_buffer
[
MAX_PATH
];
}
info
;
HANDLE
events
[
2
];
DWORD
ret
;
/* the buffer must be DWORD aligned */
C_ASSERT
(
!
(
sizeof
(
info
)
&
3
));
memset
(
&
info
,
0
,
sizeof
(
info
));
ret
=
ReadDirectoryChangesW
(
htasks
,
&
info
,
sizeof
(
info
),
FALSE
,
FILE_NOTIFY_CHANGE_FILE_NAME
,
NULL
,
&
ov
,
NULL
);
if
(
!
ret
)
break
;
events
[
0
]
=
done_event
;
events
[
1
]
=
ov
.
hEvent
;
ret
=
WaitForMultipleObjects
(
2
,
events
,
FALSE
,
INFINITE
);
if
(
ret
==
WAIT_OBJECT_0
)
break
;
switch
(
info
.
data
.
Action
)
{
default:
FIXME
(
"%s: action %#x not handled
\n
"
,
debugstr_w
(
info
.
data
.
FileName
),
info
.
data
.
Action
);
break
;
}
}
CloseHandle
(
ov
.
hEvent
);
CloseHandle
(
htasks
);
TRACE
(
"Finished.
\n
"
);
return
0
;
}
void
schedsvc_auto_start
(
void
)
{
static
DWORD
start_type
;
...
...
@@ -201,6 +261,9 @@ static void RPC_finish(void)
void
WINAPI
ServiceMain
(
DWORD
argc
,
LPWSTR
*
argv
)
{
HANDLE
thread
;
DWORD
tid
;
TRACE
(
"starting Task Scheduler Service
\n
"
);
schedsvc_handle
=
RegisterServiceCtrlHandlerW
(
scheduleW
,
schedsvc_handler
);
...
...
@@ -210,14 +273,16 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
return
;
}
done_event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
schedsvc_update_status
(
SERVICE_START_PENDING
);
if
(
RPC_init
()
==
RPC_S_OK
)
done_event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
thread
=
CreateThread
(
NULL
,
0
,
tasks_monitor_thread
,
NULL
,
0
,
&
tid
);
if
(
thread
&&
RPC_init
()
==
RPC_S_OK
)
{
schedsvc_update_status
(
SERVICE_RUNNING
);
WaitForSingleObject
(
done_event
,
INFINITE
);
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
thread
);
RPC_finish
();
}
...
...
loader/wine.inf.in
View file @
2eb6f886
...
...
@@ -2579,6 +2579,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
10,help,
10,inf,
10,logs,
10,tasks,
10,temp,
11,catroot,
11,mui,
...
...
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