Commit bd31e320 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

schedsvc: Avoid deadlock when scheduler service starts rpcss.

parent e3cda2c4
......@@ -175,8 +175,6 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
{
TRACE("starting Task Scheduler Service\n");
if (RPC_init() != RPC_S_OK) return;
schedsvc_handle = RegisterServiceCtrlHandlerW(scheduleW, schedsvc_handler);
if (!schedsvc_handle)
{
......@@ -186,11 +184,15 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
done_event = CreateEventW(NULL, TRUE, FALSE, NULL);
schedsvc_update_status(SERVICE_RUNNING);
schedsvc_update_status(SERVICE_START_PENDING);
WaitForSingleObject(done_event, INFINITE);
if (RPC_init() == RPC_S_OK)
{
schedsvc_update_status(SERVICE_RUNNING);
WaitForSingleObject(done_event, INFINITE);
RPC_finish();
}
RPC_finish();
schedsvc_update_status(SERVICE_STOPPED);
TRACE("exiting Task Scheduler Service\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment