diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-14 19:39:24 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-14 19:39:24 +0000 |
commit | d16cc7f012fbe3eca75a7c711604a4f3f4c0846f (patch) | |
tree | bc19e0bf1de8f28a4d199d5f3f80d18c59ea30de /lib/bbackupd/Win32BackupService.cpp | |
parent | c459a8b5c88d82c44874edc6933c53a2b2a422d1 (diff) | |
parent | 25155a7021a5145c3c2c38b0a2511f94a9243bf3 (diff) |
Merge branch 'appveyor' of github.com:boxbackup/boxbackup into appveyor
Diffstat (limited to 'lib/bbackupd/Win32BackupService.cpp')
-rw-r--r-- | lib/bbackupd/Win32BackupService.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/bbackupd/Win32BackupService.cpp b/lib/bbackupd/Win32BackupService.cpp new file mode 100644 index 00000000..6d027abf --- /dev/null +++ b/lib/bbackupd/Win32BackupService.cpp @@ -0,0 +1,48 @@ +// Win32 service functions for Box Backup, by Nick Knight + +#ifdef WIN32 + +#include "Box.h" +#include "BackupDaemon.h" +#include "MainHelper.h" +#include "BoxPortsAndFiles.h" +#include "BackupStoreException.h" + +#include "MemLeakFindOn.h" + +#include "Win32BackupService.h" + +Win32BackupService* gpDaemonService = NULL; +extern HANDLE gStopServiceEvent; +extern DWORD gServiceReturnCode; + +unsigned int WINAPI RunService(LPVOID lpParameter) +{ + DWORD retVal = gpDaemonService->WinService((const char*) lpParameter); + gServiceReturnCode = retVal; + SetEvent(gStopServiceEvent); + return retVal; +} + +void TerminateService(void) +{ + gpDaemonService->SetTerminateWanted(); +} + +DWORD Win32BackupService::WinService(const char* pConfigFileName) +{ + DWORD ret; + + if (pConfigFileName != NULL) + { + ret = this->Main(pConfigFileName); + } + else + { + ret = this->Main(BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE); + } + + return ret; +} + +#endif // WIN32 |