refactor: use ArchDaemonWindows::runDeamon directly
remove now unused ArchMiscWindows::runDaemon
This commit is contained in:
parent
0e04364d17
commit
0c368f402b
5 changed files with 4 additions and 16 deletions
|
|
@ -41,7 +41,7 @@ public:
|
||||||
Becomes a service. Argument 0 is the name of the service
|
Becomes a service. Argument 0 is the name of the service
|
||||||
and the rest are the arguments passed to StartService().
|
and the rest are the arguments passed to StartService().
|
||||||
\c func is only called when the service is actually started.
|
\c func is only called when the service is actually started.
|
||||||
\c func must call \c ArchMiscWindows::runDaemon() to finally
|
\c func must call \c ArchDaemonWindows::runDaemon() to finally
|
||||||
becoming a service. The \c runFunc function passed to \c runDaemon()
|
becoming a service. The \c runFunc function passed to \c runDaemon()
|
||||||
must call \c ArchDaemonWindows::daemonRunning(true) when it
|
must call \c ArchDaemonWindows::daemonRunning(true) when it
|
||||||
enters the main loop (i.e. after initialization) and
|
enters the main loop (i.e. after initialization) and
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
#include "arch/win32/ArchMiscWindows.h"
|
||||||
|
|
||||||
#include "arch/win32/ArchDaemonWindows.h"
|
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
#include "base/String.h"
|
#include "base/String.h"
|
||||||
|
|
@ -65,11 +64,6 @@ void ArchMiscWindows::init()
|
||||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ArchMiscWindows::runDaemon(RunFunc runFunc)
|
|
||||||
{
|
|
||||||
return ArchDaemonWindows::runDaemon(runFunc);
|
|
||||||
}
|
|
||||||
|
|
||||||
HKEY ArchMiscWindows::openKey(HKEY key, const TCHAR *keyName)
|
HKEY ArchMiscWindows::openKey(HKEY key, const TCHAR *keyName)
|
||||||
{
|
{
|
||||||
return openKey(key, keyName, false);
|
return openKey(key, keyName, false);
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,6 @@ public:
|
||||||
//! Initialize
|
//! Initialize
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
//! Run the daemon
|
|
||||||
/*!
|
|
||||||
Delegates to ArchDaemonWindows.
|
|
||||||
*/
|
|
||||||
static int runDaemon(RunFunc runFunc);
|
|
||||||
|
|
||||||
//! Open and return a registry key, closing the parent key
|
//! Open and return a registry key, closing the parent key
|
||||||
static HKEY openKey(HKEY parent, const TCHAR *child);
|
static HKEY openKey(HKEY parent, const TCHAR *child);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
|
|
||||||
#include "arch/win32/ArchMiscWindows.h" // IWYU pragma: keep
|
#include "arch/win32/ArchDaemonWindows.h"
|
||||||
#include "deskflow/Screen.h"
|
#include "deskflow/Screen.h"
|
||||||
#include "platform/MSWindowsDebugOutputter.h"
|
#include "platform/MSWindowsDebugOutputter.h"
|
||||||
#include "platform/MSWindowsEventQueueBuffer.h"
|
#include "platform/MSWindowsEventQueueBuffer.h"
|
||||||
|
|
@ -164,7 +164,7 @@ int DaemonApp::daemonLoop()
|
||||||
{
|
{
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
// Runs the daemon through the Windows service controller, which controls the program lifecycle.
|
// Runs the daemon through the Windows service controller, which controls the program lifecycle.
|
||||||
return ArchMiscWindows::runDaemon([this]() { return mainLoop(); });
|
return ArchDaemonWindows::runDaemon([this]() { return mainLoop(); });
|
||||||
#elif SYSAPI_UNIX
|
#elif SYSAPI_UNIX
|
||||||
return mainLoop();
|
return mainLoop();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ int AppUtilWindows::daemonNTMainLoop()
|
||||||
{
|
{
|
||||||
app().initApp();
|
app().initApp();
|
||||||
|
|
||||||
return ArchMiscWindows::runDaemon(mainLoopStatic);
|
return ArchDaemonWindows::runDaemon(mainLoopStatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppUtilWindows::exitApp(int code)
|
void AppUtilWindows::exitApp(int code)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue