mirror of
https://github.com/reactos/reactos.git
synced 2024-07-21 03:37:57 +00:00
Wait for the SCM to be fully initialized before calling allowing a call to OpenSCManager
svn path=/trunk/; revision=27695
This commit is contained in:
parent
e47b3f0dfa
commit
972d9788d0
|
@ -1511,6 +1511,9 @@ ScmrOpenSCManagerW(handle_t BindingHandle,
|
||||||
if (ScmShutdown)
|
if (ScmShutdown)
|
||||||
return ERROR_SHUTDOWN_IN_PROGRESS;
|
return ERROR_SHUTDOWN_IN_PROGRESS;
|
||||||
|
|
||||||
|
if (!ScmWaitForEvent())
|
||||||
|
return ERROR_ACCESS_DENIED;
|
||||||
|
|
||||||
dwError = ScmCreateManagerHandle(lpDatabaseName,
|
dwError = ScmCreateManagerHandle(lpDatabaseName,
|
||||||
&hHandle);
|
&hHandle);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
|
|
|
@ -94,6 +94,27 @@ ScmCreateStartEvent(PHANDLE StartEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL ScmWaitForEvent()
|
||||||
|
{
|
||||||
|
HANDLE hEvent;
|
||||||
|
|
||||||
|
hEvent = OpenEvent(EVENT_ALL_ACCESS,
|
||||||
|
FALSE,
|
||||||
|
TEXT("SvcctrlStartEvent_A3752DX"));
|
||||||
|
|
||||||
|
if (hEvent)
|
||||||
|
{
|
||||||
|
DWORD ret = WaitForSingleObject(hEvent,
|
||||||
|
INFINITE);
|
||||||
|
|
||||||
|
if (ret == WAIT_OBJECT_0)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
ScmNamedPipeHandleRequest(PVOID Request,
|
ScmNamedPipeHandleRequest(PVOID Request,
|
||||||
DWORD RequestSize,
|
DWORD RequestSize,
|
||||||
|
|
|
@ -134,6 +134,7 @@ VOID ScmStartRpcServer(VOID);
|
||||||
|
|
||||||
/* services.c */
|
/* services.c */
|
||||||
|
|
||||||
|
BOOL ScmWaitForEvent();
|
||||||
VOID PrintString(LPCSTR fmt, ...);
|
VOID PrintString(LPCSTR fmt, ...);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue