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
9aa42351
Commit
9aa42351
authored
Jun 06, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Mark service processes as system processes, and exit when all user processes are done.
parent
d45450de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
service.c
dlls/advapi32/service.c
+24
-3
No files found.
dlls/advapi32/service.c
View file @
9aa42351
...
...
@@ -89,6 +89,8 @@ static CRITICAL_SECTION service_cs = { &service_cs_debug, -1, 0, 0, 0, 0 };
static
struct
list
service_list
=
LIST_INIT
(
service_list
);
extern
HANDLE
__wine_make_process_system
(
void
);
/******************************************************************************
* SC_HANDLEs
*/
...
...
@@ -774,18 +776,37 @@ static BOOL service_run_threads(void)
TRACE
(
"starting %d pipe listener threads
\n
"
,
count
);
handles
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HANDLE
)
*
count
);
handles
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HANDLE
)
*
(
count
+
1
));
handles
[
n
++
]
=
__wine_make_process_system
();
LIST_FOR_EACH_ENTRY
(
service
,
&
service_list
,
service_data
,
entry
)
handles
[
n
++
]
=
CreateThread
(
NULL
,
0
,
service_control_dispatcher
,
service
,
0
,
NULL
);
assert
(
n
==
count
);
assert
(
n
==
count
+
1
);
LeaveCriticalSection
(
&
service_cs
);
/* wait for all the threads to pack up and exit */
WaitForMultipleObjectsEx
(
count
,
handles
,
TRUE
,
INFINITE
,
FALSE
);
while
(
n
>
1
)
{
DWORD
ret
=
WaitForMultipleObjects
(
min
(
n
,
MAXIMUM_WAIT_OBJECTS
),
handles
,
FALSE
,
INFINITE
);
if
(
!
ret
)
/* system process event */
{
TRACE
(
"last user process exited, shutting down
\n
"
);
/* FIXME: we should maybe send a shutdown control to running services */
ExitProcess
(
0
);
}
if
(
ret
<
MAXIMUM_WAIT_OBJECTS
)
{
CloseHandle
(
handles
[
ret
]
);
memmove
(
&
handles
[
ret
],
&
handles
[
ret
+
1
],
(
n
-
ret
-
1
)
*
sizeof
(
HANDLE
)
);
n
--
;
}
else
break
;
}
while
(
n
)
CloseHandle
(
handles
[
--
n
]
);
HeapFree
(
GetProcessHeap
(),
0
,
handles
);
return
TRUE
;
...
...
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