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
36ccc45d
Commit
36ccc45d
authored
Aug 18, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Track number of services per process.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b08ce1ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
rpc.c
programs/services/rpc.c
+7
-2
services.c
programs/services/services.c
+4
-1
services.h
programs/services/services.h
+1
-0
No files found.
programs/services/rpc.c
View file @
36ccc45d
...
...
@@ -761,7 +761,8 @@ DWORD __cdecl svcctl_SetServiceStatus(
if
(
lpServiceStatus
->
dwCurrentState
==
SERVICE_STOPPED
)
{
service
->
service_entry
->
process
=
NULL
;
terminate_after_timeout
(
process
,
service_kill_timeout
);
if
(
!--
process
->
use_count
)
terminate_after_timeout
(
process
,
service_kill_timeout
);
release_process
(
process
);
}
else
...
...
@@ -1135,7 +1136,11 @@ DWORD __cdecl svcctl_ControlService(
{
result
=
ERROR_SERVICE_CANNOT_ACCEPT_CTRL
;
if
((
process
=
service
->
service_entry
->
process
))
process_terminate
(
process
);
{
service
->
service_entry
->
process
=
NULL
;
if
(
!--
process
->
use_count
)
process_terminate
(
process
);
release_process
(
process
);
}
}
if
(
result
!=
ERROR_SUCCESS
)
...
...
programs/services/services.c
View file @
36ccc45d
...
...
@@ -752,8 +752,9 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p
service_unlock
(
service_entry
);
return
ERROR_SERVICE_ALREADY_RUNNING
;
}
release_process
(
process
);
service_entry
->
process
=
NULL
;
process
->
use_count
--
;
release_process
(
process
);
}
service_entry
->
force_shutdown
=
FALSE
;
...
...
@@ -784,6 +785,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p
service_entry
->
status
.
dwCurrentState
=
SERVICE_START_PENDING
;
scmdatabase_add_process
(
service_entry
->
db
,
process
);
service_entry
->
process
=
grab_process
(
process
);
process
->
use_count
++
;
service_unlock
(
service_entry
);
...
...
@@ -945,6 +947,7 @@ void process_terminate(struct process_entry *process)
if
(
service
->
process
!=
process
)
continue
;
service
->
status
.
dwCurrentState
=
SERVICE_STOPPED
;
service
->
process
=
NULL
;
process
->
use_count
--
;
release_process
(
process
);
}
scmdatabase_unlock
(
db
);
...
...
programs/services/services.h
View file @
36ccc45d
...
...
@@ -37,6 +37,7 @@ struct process_entry
struct
list
entry
;
struct
scmdatabase
*
db
;
LONG
ref_count
;
LONG
use_count
;
DWORD
process_id
;
HANDLE
process
;
HANDLE
control_mutex
;
...
...
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