mbctype.h: fix broken _mbctype[] and _mbcasemap[] declarations
[reactos.git] / rosapps / applications / sysutils / telnetd / serviceentry.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: services/TelnetD/TelnetD.c
5 * PURPOSE: Printer spooler
6 * PROGRAMMER: Eric Kohl
7 */
8
9 /* INCLUDES *****************************************************************/
10
11 #include "telnetd.h"
12 #define DPRINT printf
13
14 /* GLOBALS ******************************************************************/
15
16 #define SERVICE_NAME TEXT("TelnetD")
17
18 SERVICE_STATUS_HANDLE ServiceStatusHandle;
19
20
21 /* FUNCTIONS *****************************************************************/
22
23
24 static DWORD WINAPI
25 ServiceControlHandler(DWORD dwControl,
26 DWORD dwEventType,
27 LPVOID lpEventData,
28 LPVOID lpContext)
29 {
30 switch (dwControl)
31 {
32 case SERVICE_CONTROL_STOP:
33 case SERVICE_CONTROL_SHUTDOWN:
34 return ERROR_SUCCESS;
35
36 default :
37 return ERROR_CALL_NOT_IMPLEMENTED;
38 }
39 }
40
41
42
43 static VOID CALLBACK
44 ServiceMain(DWORD argc, LPTSTR *argv)
45 {
46 UNREFERENCED_PARAMETER(argc);
47 UNREFERENCED_PARAMETER(argv);
48
49 DPRINT("ServiceMain() called\n");
50
51 ServiceStatusHandle = RegisterServiceCtrlHandlerExW(SERVICE_NAME,
52 ServiceControlHandler,
53 NULL);
54
55 DPRINT("ServiceMain() done\n");
56 }
57
58
59 int
60 wmain(int argc, WCHAR *argv[])
61 {
62 SERVICE_TABLE_ENTRY ServiceTable[2] =
63 {
64 {SERVICE_NAME, ServiceMain},
65 {NULL, NULL}
66 };
67
68 UNREFERENCED_PARAMETER(argc);
69 UNREFERENCED_PARAMETER(argv);
70
71 DPRINT("TelnetD: main() started\n");
72
73 StartServiceCtrlDispatcher(ServiceTable);
74
75 telnetd_main();
76
77 DPRINT("TelnetD: main() done\n");
78
79 ExitThread(0);
80
81 return 0;
82 }
83
84 /* EOF */