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
319081cb
Commit
319081cb
authored
Oct 27, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Wait up to 30 seconds for services to start up.
parent
d1e49da2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
action.c
dlls/msi/action.c
+32
-2
No files found.
dlls/msi/action.c
View file @
319081cb
...
...
@@ -5649,8 +5649,10 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
SC_HANDLE
scm
=
NULL
,
service
=
NULL
;
LPCWSTR
component
,
*
vector
=
NULL
;
LPWSTR
name
,
args
,
display_name
=
NULL
;
DWORD
event
,
numargs
,
len
;
DWORD
event
,
numargs
,
len
,
wait
,
dummy
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
SERVICE_STATUS_PROCESS
status
;
ULONGLONG
start_time
;
component
=
MSI_RecordGetString
(
rec
,
6
);
comp
=
msi_get_loaded_component
(
package
,
component
);
...
...
@@ -5667,6 +5669,7 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
deformat_string
(
package
,
MSI_RecordGetString
(
rec
,
2
),
&
name
);
deformat_string
(
package
,
MSI_RecordGetString
(
rec
,
4
),
&
args
);
event
=
MSI_RecordGetInteger
(
rec
,
3
);
wait
=
MSI_RecordGetInteger
(
rec
,
5
);
if
(
!
(
event
&
msidbServiceControlEventStart
))
{
...
...
@@ -5689,7 +5692,7 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
GetServiceDisplayNameW
(
scm
,
name
,
display_name
,
&
len
);
}
service
=
OpenServiceW
(
scm
,
name
,
SERVICE_START
);
service
=
OpenServiceW
(
scm
,
name
,
SERVICE_START
|
SERVICE_QUERY_STATUS
);
if
(
!
service
)
{
ERR
(
"Failed to open service %s (%u)
\n
"
,
debugstr_w
(
name
),
GetLastError
());
...
...
@@ -5706,6 +5709,33 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
}
r
=
ERROR_SUCCESS
;
if
(
wait
)
{
/* wait for at most 30 seconds for the service to be up and running */
if
(
!
QueryServiceStatusEx
(
service
,
SC_STATUS_PROCESS_INFO
,
(
BYTE
*
)
&
status
,
sizeof
(
SERVICE_STATUS_PROCESS
),
&
dummy
))
{
TRACE
(
"failed to query service status (%u)
\n
"
,
GetLastError
());
goto
done
;
}
start_time
=
GetTickCount64
();
while
(
status
.
dwCurrentState
==
SERVICE_START_PENDING
)
{
if
(
GetTickCount64
()
-
start_time
>
30000
)
break
;
Sleep
(
1000
);
if
(
!
QueryServiceStatusEx
(
service
,
SC_STATUS_PROCESS_INFO
,
(
BYTE
*
)
&
status
,
sizeof
(
SERVICE_STATUS_PROCESS
),
&
dummy
))
{
TRACE
(
"failed to query service status (%u)
\n
"
,
GetLastError
());
goto
done
;
}
}
if
(
status
.
dwCurrentState
!=
SERVICE_RUNNING
)
{
WARN
(
"service failed to start %u
\n
"
,
status
.
dwCurrentState
);
r
=
ERROR_FUNCTION_FAILED
;
}
}
done:
uirow
=
MSI_CreateRecord
(
2
);
...
...
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