mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 17:35:07 +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)
|
||||
return ERROR_SHUTDOWN_IN_PROGRESS;
|
||||
|
||||
if (!ScmWaitForEvent())
|
||||
return ERROR_ACCESS_DENIED;
|
||||
|
||||
dwError = ScmCreateManagerHandle(lpDatabaseName,
|
||||
&hHandle);
|
||||
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
|
||||
ScmNamedPipeHandleRequest(PVOID Request,
|
||||
DWORD RequestSize,
|
||||
|
|
|
@ -134,6 +134,7 @@ VOID ScmStartRpcServer(VOID);
|
|||
|
||||
/* services.c */
|
||||
|
||||
BOOL ScmWaitForEvent();
|
||||
VOID PrintString(LPCSTR fmt, ...);
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue