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
01ef66cb
Commit
01ef66cb
authored
Dec 12, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Move service cleanup code to separate function.
parent
bc866c89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
+27
-16
rpc.c
programs/services/rpc.c
+5
-0
services.c
programs/services/services.c
+21
-16
services.h
programs/services/services.h
+1
-0
No files found.
programs/services/rpc.c
View file @
01ef66cb
...
...
@@ -1062,6 +1062,11 @@ DWORD __cdecl svcctl_ControlService(
break
;
}
if
(
result
==
ERROR_SUCCESS
&&
!
service
->
service_entry
->
control_mutex
)
{
result
=
ERROR_SERVICE_CANNOT_ACCEPT_CTRL
;
service_terminate
(
service
->
service_entry
);
}
if
(
result
!=
ERROR_SUCCESS
)
{
if
(
lpServiceStatus
)
...
...
programs/services/services.c
View file @
01ef66cb
...
...
@@ -847,22 +847,7 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
if
(
err
==
ERROR_SUCCESS
)
ReleaseMutex
(
service
->
control_mutex
);
else
{
CloseHandle
(
service
->
overlapped_event
);
service
->
overlapped_event
=
NULL
;
CloseHandle
(
service
->
status_changed_event
);
service
->
status_changed_event
=
NULL
;
CloseHandle
(
service
->
control_mutex
);
service
->
control_mutex
=
NULL
;
if
(
service
->
control_pipe
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
service
->
control_pipe
);
service
->
control_pipe
=
INVALID_HANDLE_VALUE
;
service
->
status
.
dwProcessId
=
0
;
service_lock_exclusive
(
service
);
service
->
status
.
dwCurrentState
=
SERVICE_STOPPED
;
service_unlock
(
service
);
}
service_terminate
(
service
);
scmdatabase_unlock_startup
(
service
->
db
);
WINE_TRACE
(
"returning %d
\n
"
,
err
);
...
...
@@ -870,6 +855,26 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
return
err
;
}
void
service_terminate
(
struct
service_entry
*
service
)
{
service_lock_exclusive
(
service
);
TerminateProcess
(
service
->
process
,
0
);
CloseHandle
(
service
->
process
);
service
->
process
=
NULL
;
CloseHandle
(
service
->
overlapped_event
);
service
->
overlapped_event
=
NULL
;
CloseHandle
(
service
->
status_changed_event
);
service
->
status_changed_event
=
NULL
;
CloseHandle
(
service
->
control_mutex
);
service
->
control_mutex
=
NULL
;
CloseHandle
(
service
->
control_pipe
);
service
->
control_pipe
=
INVALID_HANDLE_VALUE
;
service
->
status
.
dwProcessId
=
0
;
service
->
status
.
dwCurrentState
=
SERVICE_STOPPED
;
service_unlock
(
service
);
}
static
void
load_registry_parameters
(
void
)
{
static
const
WCHAR
controlW
[]
=
...
...
programs/services/services.h
View file @
01ef66cb
...
...
@@ -78,6 +78,7 @@ void service_lock_shared(struct service_entry *service);
void
service_lock_exclusive
(
struct
service_entry
*
service
);
void
service_unlock
(
struct
service_entry
*
service
);
DWORD
service_start
(
struct
service_entry
*
service
,
DWORD
service_argc
,
LPCWSTR
*
service_argv
);
void
service_terminate
(
struct
service_entry
*
service
);
BOOL
service_send_command
(
struct
service_entry
*
service
,
HANDLE
pipe
,
const
void
*
data
,
DWORD
size
,
DWORD
*
result
);
...
...
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