3ecfd8efae3707b81fcdd8c45d6c594706f9d722
[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 main(int argc, CHAR *argv[])
61 {
62 #if 0
63 SERVICE_TABLE_ENTRY ServiceTable[2] =
64 {
65 {SERVICE_NAME, ServiceMain},
66 {NULL, NULL}
67 };
68
69 UNREFERENCED_PARAMETER(argc);
70 UNREFERENCED_PARAMETER(argv);
71
72 DPRINT("TelnetD: main() started\n");
73
74 StartServiceCtrlDispatcher(ServiceTable);
75 #endif
76
77 telnetd_main();
78
79 DPRINT("TelnetD: main() done\n");
80
81 ExitThread(0);
82
83 return 0;
84 }
85
86 /* EOF */