118 char *msg =
"Note the errors or messages above, "
119 "and press the <ESC> key to exit. ";
145 if ((
in.EventType ==
KEY_EVENT) &&
in.Event.KeyEvent.bKeyDown
146 && (
in.Event.KeyEvent.uChar.AsciiChar == 27))
228 if (
ctx->hServiceStatus)
231 ctx->ssStatus.dwWaitHint = 0;
232 ctx->ssStatus.dwCheckPoint = 0;
237 ctx->ssStatus.dwWaitHint = 0;
238 ctx->ssStatus.dwCheckPoint = 0;
241 && !
ctx->ssStatus.dwServiceSpecificExitCode)
242 ctx->ssStatus.dwServiceSpecificExitCode = 1;
243 if (
ctx->ssStatus.dwServiceSpecificExitCode)
247 ++
ctx->ssStatus.dwCheckPoint;
248 ctx->ssStatus.dwControlsAccepted = 0;
287#if APR_HAS_UNICODE_FS
306#if APR_HAS_UNICODE_FS
375#if APR_HAS_UNICODE_FS
393 ctx->ssStatus.dwCheckPoint = 1;
394 if (!(
ctx->hServiceStatus =
399 APLOGNO(00365)
"Failure registering service handler");
463 ctx->ssStatus.dwCheckPoint = 1;
465 if (!(
ctx->hServiceStatus =
470 APLOGNO(10008)
"Failure registering service handler");
513#if APR_HAS_UNICODE_FS
529#if APR_HAS_UNICODE_FS
544 APLOGNO(00366)
"Error starting Windows service control "
574#if APR_HAS_UNICODE_FS
625 "No ConfigArgs registered for the '%s' service, "
626 "perhaps this service is not installed?",
754#if APR_HAS_UNICODE_FS
760 :
"Installing the '%s' service\n",
763#if APR_HAS_UNICODE_FS
794 APLOGNO(00368)
"GetModuleFileName failed");
803 APLOGNO(00369)
"Failed to open the Windows service "
804 "manager, perhaps you forgot to log in as Administrator?");
809#if APR_HAS_UNICODE_FS
827 APLOGNO(00373)
"Failed to open the '%s' service",
832#if APR_HAS_UNICODE_FS
859 APLOGNO(02652)
"ChangeServiceConfig failed");
873#if APR_HAS_UNICODE_FS
913 APLOGNO(00370)
"Failed to create the '%s' service",
936 APLOGNO(00371)
"Failed to store ConfigArgs for the "
940 fprintf(
stderr,
"The '%s' service is successfully installed.\n",
959 APLOGNO(10009)
"Failed to open the Windows service "
960 "manager, perhaps you forgot to log in as Administrator?");
964#if APR_HAS_UNICODE_FS
979 APLOGNO(10010)
"Failed to open the '%s' service",
998 APLOGNO(00374)
"Failed to delete the '%s' service",
1006 fprintf(
stderr,
"The '%s' service has been removed successfully.\n",
1036 const char *
const *
argv)
1049 APLOGNO(10011)
"Failed to open the Windows service "
1050 "manager, perhaps you forgot to log in as Administrator?");
1054#if APR_HAS_UNICODE_FS
1071 APLOGNO(10012)
"Failed to open the '%s' service",
1080 APLOGNO(00377)
"The '%s' service is already started!",
1088#if APR_HAS_UNICODE_FS
1138 "Failed to start the '%s' service",
1159 APLOGNO(10013)
"Failed to open the Windows service "
1160 "manager, perhaps you forgot to log in as Administrator?");
1164#if APR_HAS_UNICODE_FS
1186 APLOGNO(10014)
"Failed to open the '%s' service",
1195 APLOGNO(00381)
"Query of the '%s' service failed",
1210 :
"The '%s' service is stopping.\n",
1235 :
"The '%s' service has stopped.\n",
1239 :
"Failed to stop the '%s' service.\n",
APR-style Win32 Registry Manipulation.
#define WaitForMultipleObjects(d1, ah, b, d2)
#define CreateThread(sd, d1, fn, pv, d2, pd3)
#define GetCurrentProcess()
#define GetCurrentThread()
#define DuplicateHandle(h1, h2, h3, ph4, d1, b, d2)
#define WaitForSingleObject(h, d)
APR general purpose library routines.
#define APLOG_USE_MODULE(foo)
const char * ap_get_server_description(void)
void mpm_start_child_console_handler(void)
apr_status_t mpm_service_start(apr_pool_t *ptemp, int argc, const char *const *argv)
apr_status_t mpm_service_to_start(const char **display_name, apr_pool_t *p)
apr_status_t mpm_service_set_name(apr_pool_t *p, const char **display_name, const char *set_name)
void mpm_signal_service(apr_pool_t *ptemp, int signal)
void hold_console_open_on_error(void)
void mpm_start_console_handler(void)
#define SERVICE_APACHE_RESTART
void ap_signal_parent(ap_signal_parent_e type)
void mpm_service_stopping(void)
apr_status_t mpm_service_uninstall(void)
apr_status_t mpm_service_started(void)
apr_status_t mpm_service_install(apr_pool_t *ptemp, int argc, const char *const *argv, int reconfig)
void mpm_nt_eventlog_stderr_flush(void)
apr_status_t mpm_merge_service_args(apr_pool_t *p, apr_array_header_t *args, int fixed_args)
apr_file_t apr_off_t start
apr_brigade_flush void * ctx
const char apr_ssize_t slen
#define apr_get_os_error()
apr_array_header_t ** result
const char const char *const * args
static const char * display_name
apr_array_header_t * mpm_new_argv
static nt_service_ctx_t globdat
static DWORD WINAPI service_nt_dispatch_thread(LPVOID nada)
static int signal_service_transition(SC_HANDLE schService, DWORD signal, DWORD pending, DWORD complete)
static DWORD WINAPI service_nt_ctrl(DWORD dwCtrlCode, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
static BOOL CALLBACK console_control_handler(DWORD ctrl_type)
static fpt_OpenSCManager pfn_OpenSCManager
static char * mpm_display_name
static int ReportStatusToSCMgr(int currentState, int waitHint, nt_service_ctx_t *ctx)
static char * mpm_service_name
static void service_stopped(void)
static APR_INLINE SC_HANDLE OpenSCManager(const void *lpMachine, const void *lpDatabase, DWORD dwAccess)
static void stop_console_handler(void)
static void set_service_description(void)
SC_HANDLE(WINAPI * fpt_OpenSCManager)(const void *lpMachine, const void *lpDatabase, DWORD dwAccess)
SERVICE_STATUS_HANDLE hServiceStatus
#define ELSE_WIN_OS_IS_ANSI
typedef HANDLE(WINAPI *apr_winapi_fpt_CreateToolhelp32Snapshot)(DWORD dwFlags
#define IF_WIN_OS_IS_UNICODE
typedef DWORD(WINAPI *apr_winapi_fpt_GetCompressedFileSizeA)(IN LPCSTR lpFileName