MySQL 8.0.40
Source Code Documentation
|
#include <nt_servc.h>
Public Member Functions | |
NTService () | |
~NTService () | |
BOOL | GetOS () noexcept |
BOOL | IsNT () |
long | Init (LPCSTR szInternName, void *ServiceThread, void(*fpReqAppShutdownCb)()) noexcept |
void | SetShutdownEvent (HANDLE hEvent) noexcept |
BOOL | Install (int startType, LPCSTR szInternName, LPCSTR szDisplayName, LPCSTR szFullPath, LPCSTR szAccountName=NULL, LPCSTR szPassword=NULL) noexcept |
Installs the service with Service manager. More... | |
BOOL | SeekStatus (LPCSTR szInternName, int OperationType) |
BOOL | Remove (LPCSTR szInternName) |
Removes the service. More... | |
BOOL | is_super_user () |
BOOL | got_service_option (char **argv, char *service_option) |
void | SetRunning (void) |
void | SetSlowStarting (unsigned long timeout) |
Sets a timeout after which SCM will abort service startup if SetRunning() was not called or the timeout was not extended with another call to SetSlowStarting(). More... | |
void | Stop (void) |
this function should be called before the app. More... | |
NTService () | |
~NTService () | |
long | Init (LPCSTR szInternName, void *ServiceThread) |
Registers the main service thread with the service manager. More... | |
void | SetShutdownEvent (HANDLE hEvent) |
BOOL | Install (int startType, LPCSTR szInternName, LPCSTR szDisplayName, LPCSTR szFullPath, LPCSTR szAccountName=NULL, LPCSTR szPassword=NULL) |
BOOL | SeekStatus (LPCSTR szInternName, int OperationType) |
BOOL | Remove (LPCSTR szInternName) |
BOOL | IsService (LPCSTR ServiceName) |
BOOL | got_service_option (char **argv, const char *service_option) |
BOOL | is_super_user () |
void | SetRunning (void) |
void | SetSlowStarting (unsigned long timeout) |
Sets a timeout after which SCM will abort service startup if SetRunning() was not called or the timeout was not extended with another call to SetSlowStarting(). More... | |
void | Stop (void) |
void | SetExitEvent (void) |
Static Public Member Functions | |
static BOOL | IsService (LPCSTR ServiceName) noexcept |
Public Attributes | |
BOOL | bOsNT |
true if OS is NT, false for Win95 More... | |
DWORD | dwDesiredAccess |
DWORD | dwServiceType |
DWORD | dwStartType |
DWORD | dwErrorControl |
LPSTR | szLoadOrderGroup |
LPDWORD | lpdwTagID |
LPSTR | szDependencies |
OSVERSIONINFO | osVer |
int | nStartTimeOut |
int | nStopTimeOut |
int | nPauseTimeOut |
int | nResumeTimeOut |
DWORD | my_argc |
LPTSTR * | my_argv |
HANDLE | hShutdownEvent |
int | nError |
DWORD | dwState |
Protected Member Functions | |
void | PauseService () |
void | ResumeService () |
void | StopService () |
BOOL | StartService () |
void | Exit (DWORD error) |
BOOL | SetStatus (DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwServiceSpecificExitCode, DWORD dwCheckPoint, DWORD dwWaitHint) |
void | PauseService () |
void | ResumeService () |
void | StopService () |
BOOL | StartService () |
void | Exit (DWORD error) |
BOOL | SetStatus (DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwServiceSpecificExitCode, DWORD dwCheckPoint, DWORD dwWaitHint) |
Static Protected Member Functions | |
static void | ServiceMain (DWORD argc, LPTSTR *argv) |
This is the function that is called from the service manager to start the service. More... | |
static void | ServiceCtrlHandler (DWORD ctrlCode) |
static void | ServiceMain (DWORD argc, LPTSTR *argv) |
static void | ServiceCtrlHandler (DWORD ctrlCode) |
Protected Attributes | |
LPSTR | ServiceName |
HANDLE | hExitEvent |
SERVICE_STATUS_HANDLE | hServiceStatusHandle |
BOOL | bPause |
BOOL | bRunning |
HANDLE | hThreadHandle |
THREAD_FC | fpServiceThread |
void(* | fpRequestApplicationShutdownCallback )() = nullptr |
NTService::NTService | ( | ) |
NTService::~NTService | ( | ) |
NTService::NTService | ( | ) |
NTService::~NTService | ( | ) |
|
protected |
|
protected |
|
noexcept |
BOOL NTService::got_service_option | ( | char ** | argv, |
char * | service_option | ||
) |
BOOL NTService::got_service_option | ( | char ** | argv, |
const char * | service_option | ||
) |
long NTService::Init | ( | LPCSTR | szInternName, |
void * | ServiceThread | ||
) |
Registers the main service thread with the service manager.
szInternName | Name of service to run in this process. |
ServiceThread | pointer to the main programs entry function when the service is started |
|
noexcept |
BOOL NTService::Install | ( | int | startType, |
LPCSTR | szInternName, | ||
LPCSTR | szDisplayName, | ||
LPCSTR | szFullPath, | ||
LPCSTR | szAccountName = NULL , |
||
LPCSTR | szPassword = NULL |
||
) |
|
noexcept |
Installs the service with Service manager.
nError values:
BOOL NTService::is_super_user | ( | ) |
BOOL NTService::is_super_user | ( | ) |
|
inline |
BOOL NTService::IsService | ( | LPCSTR | ServiceName | ) |
|
staticnoexcept |
|
protected |
|
protected |
BOOL NTService::Remove | ( | LPCSTR | szInternName | ) |
Removes the service.
nError values:
BOOL NTService::Remove | ( | LPCSTR | szInternName | ) |
|
protected |
|
protected |
BOOL NTService::SeekStatus | ( | LPCSTR | szInternName, |
int | OperationType | ||
) |
BOOL NTService::SeekStatus | ( | LPCSTR | szInternName, |
int | OperationType | ||
) |
|
staticprotected |
|
staticprotected |
|
staticprotected |
This is the function that is called from the service manager to start the service.
|
staticprotected |
void NTService::SetExitEvent | ( | void | ) |
void NTService::SetRunning | ( | void | ) |
void NTService::SetRunning | ( | void | ) |
|
inline |
|
inlinenoexcept |
void NTService::SetSlowStarting | ( | unsigned long | timeout | ) |
Sets a timeout after which SCM will abort service startup if SetRunning() was not called or the timeout was not extended with another call to SetSlowStarting().
Should be called when static initialization completes, and the variable initialization part begins
void NTService::SetSlowStarting | ( | unsigned long | timeout | ) |
Sets a timeout after which SCM will abort service startup if SetRunning() was not called or the timeout was not extended with another call to SetSlowStarting().
Should be called when static initialization completes, and the variable initialization part begins
|
protected |
|
protected |
|
protected |
|
protected |
void NTService::Stop | ( | void | ) |
this function should be called before the app.
exits to stop the service
void NTService::Stop | ( | void | ) |
|
protected |
|
protected |
BOOL NTService::bOsNT |
true if OS is NT, false for Win95
|
protected |
|
protected |
DWORD NTService::dwDesiredAccess |
DWORD NTService::dwErrorControl |
DWORD NTService::dwServiceType |
DWORD NTService::dwStartType |
DWORD NTService::dwState |
|
protected |
|
protected |
|
protected |
|
protected |
HANDLE NTService::hShutdownEvent |
|
protected |
LPDWORD NTService::lpdwTagID |
DWORD NTService::my_argc |
LPTSTR * NTService::my_argv |
int NTService::nError |
int NTService::nPauseTimeOut |
int NTService::nResumeTimeOut |
int NTService::nStartTimeOut |
int NTService::nStopTimeOut |
OSVERSIONINFO NTService::osVer |
|
protected |
LPSTR NTService::szDependencies |
LPSTR NTService::szLoadOrderGroup |