mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
[SERVICES]
Removing the redundant function WaitForLSA() and use ScmWaitForLsa() instead. Patch by Hermès Bélusca. See issue #7110 for more details. svn path=/trunk/; revision=56721
This commit is contained in:
parent
916fe2874f
commit
c8731b39d7
3 changed files with 9 additions and 46 deletions
|
@ -661,46 +661,6 @@ ScmDeleteMarkedServices(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
|
||||||
WaitForLSA(VOID)
|
|
||||||
{
|
|
||||||
HANDLE hEvent;
|
|
||||||
DWORD dwError;
|
|
||||||
|
|
||||||
DPRINT("WaitForLSA() called\n");
|
|
||||||
|
|
||||||
hEvent = CreateEventW(NULL,
|
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
L"LSA_RPC_SERVER_ACTIVE");
|
|
||||||
if (hEvent == NULL)
|
|
||||||
{
|
|
||||||
dwError = GetLastError();
|
|
||||||
DPRINT1("Failed to create the notication event (Error %lu)\n", dwError);
|
|
||||||
|
|
||||||
if (dwError == ERROR_ALREADY_EXISTS)
|
|
||||||
{
|
|
||||||
hEvent = OpenEventW(SYNCHRONIZE,
|
|
||||||
FALSE,
|
|
||||||
L"LSA_RPC_SERVER_ACTIVE");
|
|
||||||
if (hEvent != NULL)
|
|
||||||
{
|
|
||||||
DPRINT1("Could not open the notification event!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("Wait for LSA!\n");
|
|
||||||
WaitForSingleObject(hEvent, INFINITE);
|
|
||||||
DPRINT("LSA is available!\n");
|
|
||||||
|
|
||||||
CloseHandle(hEvent);
|
|
||||||
|
|
||||||
DPRINT("WaitForLSA() done\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
ScmCreateServiceDatabase(VOID)
|
ScmCreateServiceDatabase(VOID)
|
||||||
{
|
{
|
||||||
|
@ -772,8 +732,8 @@ ScmCreateServiceDatabase(VOID)
|
||||||
|
|
||||||
RegCloseKey(hServicesKey);
|
RegCloseKey(hServicesKey);
|
||||||
|
|
||||||
/* Wait for LSA */
|
/* Wait for the LSA server */
|
||||||
WaitForLSA();
|
ScmWaitForLsa();
|
||||||
|
|
||||||
/* Delete services that are marked for delete */
|
/* Delete services that are marked for delete */
|
||||||
ScmDeleteMarkedServices();
|
ScmDeleteMarkedServices();
|
||||||
|
|
|
@ -113,8 +113,8 @@ ScmCreateStartEvent(PHANDLE StartEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
VOID
|
||||||
ScmWaitForLsass(VOID)
|
ScmWaitForLsa(VOID)
|
||||||
{
|
{
|
||||||
HANDLE hEvent;
|
HANDLE hEvent;
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
@ -126,7 +126,7 @@ ScmWaitForLsass(VOID)
|
||||||
if (hEvent == NULL)
|
if (hEvent == NULL)
|
||||||
{
|
{
|
||||||
dwError = GetLastError();
|
dwError = GetLastError();
|
||||||
DPRINT("Failed to create the notication event (Error %lu)\n", dwError);
|
DPRINT1("Failed to create the notication event (Error %lu)\n", dwError);
|
||||||
|
|
||||||
if (dwError == ERROR_ALREADY_EXISTS)
|
if (dwError == ERROR_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,8 @@ ScmWaitForLsass(VOID)
|
||||||
DPRINT("LSA server running!\n");
|
DPRINT("LSA server running!\n");
|
||||||
|
|
||||||
CloseHandle(hEvent);
|
CloseHandle(hEvent);
|
||||||
|
|
||||||
|
DPRINT("ScmWaitForLsa() done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -420,7 +422,7 @@ wWinMain(HINSTANCE hInstance,
|
||||||
SetConsoleCtrlHandler(ShutdownHandlerRoutine, TRUE);
|
SetConsoleCtrlHandler(ShutdownHandlerRoutine, TRUE);
|
||||||
|
|
||||||
/* Wait for the LSA server */
|
/* Wait for the LSA server */
|
||||||
ScmWaitForLsass();
|
ScmWaitForLsa();
|
||||||
|
|
||||||
/* Acquire privileges to load drivers */
|
/* Acquire privileges to load drivers */
|
||||||
AcquireLoadDriverPrivilege();
|
AcquireLoadDriverPrivilege();
|
||||||
|
|
|
@ -161,6 +161,7 @@ VOID PrintString(LPCSTR fmt, ...);
|
||||||
VOID ScmLogError(DWORD dwEventId,
|
VOID ScmLogError(DWORD dwEventId,
|
||||||
WORD wStrings,
|
WORD wStrings,
|
||||||
LPCWSTR *lpStrings);
|
LPCWSTR *lpStrings);
|
||||||
|
VOID ScmWaitForLsa(VOID);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue