1 /* $Id: services.c,v 1.1 2000/12/05 02:38:08 ekohl Exp $
3 * service control manager
5 * ReactOS Operating System
7 * --------------------------------------------------------------------
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
27 * - Services.exe is NOT a native application, it is a GUI app.
30 /* INCLUDES *****************************************************************/
32 #define NTOS_MODE_USER
36 #include <services/services.h>
38 /* GLOBALS ******************************************************************/
43 /* FUNCTIONS *****************************************************************/
45 void PrintString (char* fmt
,...)
51 vsprintf(buffer
, fmt
, ap
);
54 WriteConsoleA(OutputHandle
, buffer
, strlen(buffer
), NULL
, NULL
);
58 BOOL
ScmCreateStartEvent(PHANDLE StartEvent
)
62 hEvent
= CreateEvent(NULL
,
65 _T("SvcctrlStartEvent_A3725DX"));
68 if (GetLastError() == ERROR_ALREADY_EXISTS
)
70 hEvent
= OpenEvent(EVENT_ALL_ACCESS
,
72 _T("SvcctrlStartEvent_A3725DX"));
90 //int main (int argc, char *argv[])
92 WinMain(HINSTANCE hInstance
,
93 HINSTANCE hPrevInstance
,
97 HANDLE hScmStartEvent
;
100 OutputHandle
= GetStdHandle(STD_OUTPUT_HANDLE
);
102 PrintString("Service Control Manager\n");
104 /* Create start event */
105 if (!ScmCreateStartEvent(&hScmStartEvent
))
107 PrintString("SERVICES: Failed to create start event\n");
114 /* FIXME: more initialization */
119 PrintString("SERVICES: Initialized.\n");
121 /* Signal start event */
122 SetEvent(hScmStartEvent
);
125 /* FIXME: more to do ? */
128 PrintString("SERVICES: Running.\n");