[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:
Eric Kohl 2012-06-11 19:02:00 +00:00
parent 916fe2874f
commit c8731b39d7
3 changed files with 9 additions and 46 deletions

View file

@ -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();

View file

@ -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();

View file

@ -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 */