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
46a97485
Commit
46a97485
authored
Aug 17, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Add a grab_service function.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2e6fc893
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
rpc.c
programs/services/rpc.c
+1
-3
services.c
programs/services/services.c
+9
-4
services.h
programs/services/services.h
+1
-0
No files found.
programs/services/rpc.c
View file @
46a97485
...
...
@@ -373,9 +373,7 @@ DWORD __cdecl svcctl_OpenServiceW(
return
ERROR_INVALID_NAME
;
scmdatabase_lock
(
manager
->
db
);
entry
=
scmdatabase_find_service
(
manager
->
db
,
lpServiceName
);
if
(
entry
!=
NULL
)
InterlockedIncrement
(
&
entry
->
ref_count
);
entry
=
grab_service
(
scmdatabase_find_service
(
manager
->
db
,
lpServiceName
));
scmdatabase_unlock
(
manager
->
db
);
if
(
entry
==
NULL
)
...
...
programs/services/services.c
View file @
46a97485
...
...
@@ -346,15 +346,13 @@ static void scmdatabase_autostart_services(struct scmdatabase *db)
break
;
services_list
=
slist_new
;
}
services_list
[
i
]
=
service
;
InterlockedIncrement
(
&
service
->
ref_count
);
i
++
;
services_list
[
i
++
]
=
grab_service
(
service
);
}
}
size
=
i
;
scmdatabase_unlock
(
db
);
size
=
i
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
DWORD
err
;
...
...
@@ -494,6 +492,13 @@ void release_process(struct process_entry *process)
scmdatabase_unlock
(
db
);
}
struct
service_entry
*
grab_service
(
struct
service_entry
*
service
)
{
if
(
service
)
InterlockedIncrement
(
&
service
->
ref_count
);
return
service
;
}
void
release_service
(
struct
service_entry
*
service
)
{
struct
scmdatabase
*
db
=
service
->
db
;
...
...
programs/services/services.h
View file @
46a97485
...
...
@@ -84,6 +84,7 @@ BOOL validate_service_name(LPCWSTR name);
BOOL
validate_service_config
(
struct
service_entry
*
entry
);
DWORD
save_service_config
(
struct
service_entry
*
entry
);
void
free_service_entry
(
struct
service_entry
*
entry
);
struct
service_entry
*
grab_service
(
struct
service_entry
*
service
);
void
release_service
(
struct
service_entry
*
service
);
void
service_lock
(
struct
service_entry
*
service
);
void
service_unlock
(
struct
service_entry
*
service
);
...
...
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