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
6a1ce3c1
Commit
6a1ce3c1
authored
Jun 26, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Only restart the directory watch once we've received data.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5bd1b6f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
svc_main.c
dlls/schedsvc/svc_main.c
+25
-22
No files found.
dlls/schedsvc/svc_main.c
View file @
6a1ce3c1
...
...
@@ -47,9 +47,17 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
static
const
WCHAR
tasksW
[]
=
{
'\\'
,
'T'
,
'a'
,
's'
,
'k'
,
's'
,
'\\'
,
0
};
WCHAR
path
[
MAX_PATH
];
HANDLE
htasks
,
hport
,
htimer
;
JOBOBJECT_ASSOCIATE_COMPLETION_PORT
info
;
JOBOBJECT_ASSOCIATE_COMPLETION_PORT
job_
info
;
OVERLAPPED
ov
;
LARGE_INTEGER
period
;
struct
{
FILE_NOTIFY_INFORMATION
data
;
WCHAR
name_buffer
[
MAX_PATH
];
}
info
;
/* the buffer must be DWORD aligned */
C_ASSERT
(
!
(
sizeof
(
info
)
&
3
));
TRACE
(
"Starting...
\n
"
);
...
...
@@ -91,9 +99,9 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
return
-
1
;
}
info
.
CompletionKey
=
hjob_queue
;
info
.
CompletionPort
=
hport
;
if
(
!
SetInformationJobObject
(
hjob_queue
,
JobObjectAssociateCompletionPortInformation
,
&
info
,
sizeof
(
info
)))
job_
info
.
CompletionKey
=
hjob_queue
;
job_
info
.
CompletionPort
=
hport
;
if
(
!
SetInformationJobObject
(
hjob_queue
,
JobObjectAssociateCompletionPortInformation
,
&
job_info
,
sizeof
(
job_
info
)))
{
ERR
(
"SetInformationJobObject failed
\n
"
);
return
-
1
;
...
...
@@ -102,28 +110,15 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
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
[
4
];
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
,
ReadDirectoryChangesW
(
htasks
,
&
info
,
sizeof
(
info
),
FALSE
,
FILE_NOTIFY_CHANGE_FILE_NAME
|
FILE_NOTIFY_CHANGE_SIZE
|
FILE_NOTIFY_CHANGE_LAST_WRITE
,
NULL
,
&
ov
,
NULL
);
if
(
!
ret
)
break
;
if
(
info
.
data
.
NextEntryOffset
)
FIXME
(
"got multiple entries
\n
"
);
for
(;;)
{
HANDLE
events
[
4
];
DWORD
ret
;
events
[
0
]
=
done_event
;
events
[
1
]
=
htimer
;
...
...
@@ -160,6 +155,9 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
continue
;
}
if
(
info
.
data
.
NextEntryOffset
)
FIXME
(
"got multiple entries
\n
"
);
/* Directory change notification */
info
.
data
.
FileName
[
info
.
data
.
FileNameLength
/
sizeof
(
WCHAR
)]
=
0
;
...
...
@@ -204,6 +202,11 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
if
(
!
SetWaitableTimer
(
htimer
,
&
period
,
0
,
NULL
,
NULL
,
FALSE
))
ERR
(
"SetWaitableTimer failed
\n
"
);
}
memset
(
&
info
,
0
,
sizeof
(
info
));
if
(
!
ReadDirectoryChangesW
(
htasks
,
&
info
,
sizeof
(
info
),
FALSE
,
FILE_NOTIFY_CHANGE_FILE_NAME
|
FILE_NOTIFY_CHANGE_SIZE
|
FILE_NOTIFY_CHANGE_LAST_WRITE
,
NULL
,
&
ov
,
NULL
))
break
;
}
CancelWaitableTimer
(
htimer
);
...
...
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