#include "tcpsvcs.h"
#include <winsvc.h>
Go to the source code of this file.
◆ PSERVICEINFO
◆ SERVICEINFO
◆ _tmain()
Definition at line 208 of file tcpsvcs.c.
209{
211 {
214 };
215
217 {
220
222 }
223
224 return 0;
225}
static SERVICE_TABLE_ENTRYW ServiceTable[2]
VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags)
BOOL WINAPI StartServiceCtrlDispatcherW(const SERVICE_TABLE_ENTRYW *lpServiceStartTable)
static WCHAR ServiceName[]
VOID WINAPI ServiceMain(DWORD argc, LPWSTR argv[])
DWORD WINAPI GetLastError(void)
◆ CreateServers()
Definition at line 64 of file tcpsvcs.c.
65{
72
74 {
78 }
79
81
83
84
86 {
89
91 0,
94 0,
96
98 {
102 }
103
105 }
106
109
110
112
114 {
117 }
118
121
123}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
DWORD WINAPI StartServer(LPVOID lpParam)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
static SERVICES Services[NUM_SERVICES]
static VOID UpdateStatus(PSERVICEINFO pServInfo, DWORD NewStatus, DWORD Check)
int PASCAL FAR WSACleanup(void)
Referenced by ServiceMain().
◆ ServerCtrlHandler()
Definition at line 126 of file tcpsvcs.c.
130{
132
133 switch (dwControl)
134 {
142 break;
143
148 break;
149
154 break;
155
158 break;
159
160 default:
161 if (dwControl > 127 && dwControl < 256)
163 else
165 break;
166 }
167}
#define InterlockedExchange
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
SERVICE_STATUS_HANDLE hStatus
SERVICE_STATUS servStatus
struct _ServiceInfo * PSERVICEINFO
#define SERVICE_STOP_PENDING
#define SERVICE_CONTROL_SHUTDOWN
#define SERVICE_CONTROL_CONTINUE
#define SERVICE_CONTROL_STOP
#define SERVICE_CONTROL_PAUSE
#define SERVICE_CONTROL_INTERROGATE
Referenced by ServiceMain().
◆ ServiceMain()
Definition at line 170 of file tcpsvcs.c.
171{
173
175
183
187 &servInfo);
190
192
194 {
198 return;
199 }
200
201 LogEvent(
L"Service threads shut down. Set SERVICE_STOPPED status", 0, 0,
LOG_FILE);
203
205}
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
DWORD dwServiceSpecificExitCode
VOID WINAPI ServerCtrlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
static BOOL CreateServers(PSERVICEINFO pServInfo)
#define ERROR_SERVICE_SPECIFIC_ERROR
#define SERVICE_ACCEPT_STOP
DWORD(WINAPI * LPHANDLER_FUNCTION_EX)(DWORD, DWORD, LPVOID, LPVOID)
#define SERVICE_START_PENDING
#define SERVICE_ACCEPT_PAUSE_CONTINUE
#define SERVICE_ACCEPT_SHUTDOWN
#define SERVICE_WIN32_OWN_PROCESS
Referenced by _tmain().
◆ UpdateStatus()
◆ bPause
◆ bShutdown
◆ ServiceName
WCHAR ServiceName[] = L"tcpsvcs" |
|
static |
◆ Services
Initial value:=
{
}
DWORD WINAPI ChargenHandler(VOID *sock_)
DWORD WINAPI DaytimeHandler(VOID *Sock_)
DWORD WINAPI DiscardHandler(VOID *sock_)
DWORD WINAPI QotdHandler(VOID *sock_)
DWORD WINAPI EchoHandler(VOID *sock_)
Definition at line 26 of file tcpsvcs.c.
Referenced by CreateServers(), and fw_profile_get_Services().