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
9087fb20
Commit
9087fb20
authored
Dec 08, 2004
by
Alexander Yaworsky
Committed by
Alexandre Julliard
Dec 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notify StartService when service control dispatcher has been
started. Otherwise StartService terminates service process.
parent
cd0970eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
service.c
dlls/advapi32/service.c
+20
-4
No files found.
dlls/advapi32/service.c
View file @
9087fb20
...
...
@@ -46,6 +46,9 @@ static const WCHAR szServiceMutexNameFmtW[] = {'A','D','V','A','P','I','_',
'M'
,
'U'
,
'X'
,
'_'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szServiceAckEventNameFmtW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'A'
,
'C'
,
'K'
,
'_'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szWaitServiceStartW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'W'
,
'a'
,
'i'
,
't'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
struct
SEB
/* service environment block */
{
/* resides in service's shared memory object */
...
...
@@ -472,6 +475,7 @@ error:
static
BOOL
service_ctrl_dispatcher
(
LPSERVICE_TABLE_ENTRYW
servent
,
BOOL
ascii
)
{
WCHAR
object_name
[
MAX_PATH
];
HANDLE
wait
;
/* FIXME: if shared service, find entry by service name */
...
...
@@ -504,6 +508,14 @@ static BOOL service_ctrl_dispatcher( LPSERVICE_TABLE_ENTRYW servent, BOOL ascii
/* ready to accept control requests */
ReleaseMutex
(
service
->
mutex
);
/* signal for StartService */
wait
=
OpenSemaphoreW
(
SEMAPHORE_MODIFY_STATE
,
FALSE
,
szWaitServiceStartW
);
if
(
wait
)
{
ReleaseSemaphore
(
wait
,
1
,
NULL
);
CloseHandle
(
wait
);
}
/* dispatcher loop */
for
(;;)
{
...
...
@@ -1223,9 +1235,6 @@ BOOL WINAPI
StartServiceW
(
SC_HANDLE
hService
,
DWORD
dwNumServiceArgs
,
LPCWSTR
*
lpServiceArgVectors
)
{
static
const
WCHAR
_WaitServiceStartW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'W'
,
'a'
,
'i'
,
't'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
_ImagePathW
[]
=
{
'I'
,
'm'
,
'a'
,
'g'
,
'e'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
struct
sc_handle
*
hsvc
=
hService
;
...
...
@@ -1306,7 +1315,7 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
argptr
+=
1
+
strlenW
(
argptr
);
}
wait
=
CreateSemaphoreW
(
NULL
,
0
,
1
,
_
WaitServiceStartW
);
wait
=
CreateSemaphoreW
(
NULL
,
0
,
1
,
sz
WaitServiceStartW
);
if
(
!
wait
)
{
ERR
(
"Couldn't create wait semaphore
\n
"
);
...
...
@@ -1341,6 +1350,13 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
CloseHandle
(
procinfo
.
hProcess
);
goto
done
;
}
if
(
WAIT_TIMEOUT
==
r
)
{
TerminateProcess
(
procinfo
.
hProcess
,
1
);
CloseHandle
(
procinfo
.
hProcess
);
SetLastError
(
ERROR_SERVICE_REQUEST_TIMEOUT
);
goto
done
;
}
/* allright */
CloseHandle
(
procinfo
.
hProcess
);
...
...
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