Author: dgorbachev
Date: Sat Feb 20 01:32:23 2010
New Revision: 45628
URL:
http://svn.reactos.org/svn/reactos?rev=45628&view=rev
Log:
[SERVICES] When autostart services are up, signal an event.
Modified:
branches/arwinss/reactos/base/system/services/services.c
Modified: branches/arwinss/reactos/base/system/services/services.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/base/system/ser…
==============================================================================
--- branches/arwinss/reactos/base/system/services/services.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/base/system/services/services.c [iso-8859-1] Sat Feb 20
01:32:23 2010
@@ -48,35 +48,33 @@
BOOL
-ScmCreateStartEvent(PHANDLE StartEvent)
+ScmCreateEvent(PHANDLE Event, LPCWSTR Name)
{
HANDLE hEvent;
- hEvent = CreateEvent(NULL,
- TRUE,
- FALSE,
- TEXT("SvcctrlStartEvent_A3752DX"));
+ hEvent = CreateEventW(NULL,
+ TRUE,
+ FALSE,
+ Name);
if (hEvent == NULL)
{
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
- hEvent = OpenEvent(EVENT_ALL_ACCESS,
- FALSE,
- TEXT("SvcctrlStartEvent_A3752DX"));
- if (hEvent == NULL)
- {
- return FALSE;
- }
- }
- else
- {
- return FALSE;
- }
- }
-
- *StartEvent = hEvent;
-
- return TRUE;
+ hEvent = OpenEventW(EVENT_ALL_ACCESS,
+ FALSE,
+ Name);
+ }
+ }
+
+ if (hEvent)
+ {
+ DPRINT("SERVICES: created event %S with handle %x\n", Name, hEvent);
+ *Event = hEvent;
+ return TRUE;
+ }
+
+ DPRINT1("SERVICES: Failed to create event %S\n", Name);
+ return FALSE;
}
@@ -299,6 +297,7 @@
int nShowCmd)
{
HANDLE hScmStartEvent;
+ HANDLE hScmAutoStartCompleteEvent;
HANDLE hEvent;
DWORD dwError;
@@ -307,14 +306,16 @@
/* Acquire privileges to load drivers */
AcquireLoadDriverPrivilege();
- /* Create start event */
- if (!ScmCreateStartEvent(&hScmStartEvent))
- {
- DPRINT1("SERVICES: Failed to create start event\n");
+ /* Create events */
+ if (!ScmCreateEvent(&hScmAutoStartCompleteEvent,
L"SC_AutoStartComplete"))
+ {
ExitThread(0);
}
- DPRINT("SERVICES: created start event with handle %x.\n", hScmStartEvent);
+ if (!ScmCreateEvent(&hScmStartEvent, L"SvcctrlStartEvent_A3752DX"))
+ {
+ ExitThread(0);
+ }
// ScmInitThreadManager();
@@ -353,6 +354,9 @@
DPRINT("SERVICES: Running.\n");
+
+ /* Signal complete event */
+ SetEvent(hScmAutoStartCompleteEvent);
#if 1
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);