blob: 1470b42d54de89f8d33ce22e6e9b0fe64688b8a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// 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;
unsigned int WINAPI RunService(LPVOID lpParameter)
{
DWORD retVal = gpDaemonService->WinService((const char*) lpParameter);
SetEvent(gStopServiceEvent);
return retVal;
}
void TerminateService(void)
{
gpDaemonService->SetTerminateWanted();
}
DWORD Win32BackupService::WinService(const char* pConfigFileName)
{
DWORD ret;
// keep MAINHELPER_START happy
int argc = 0;
char* argv[] = {NULL};
MAINHELPER_START
if (pConfigFileName != NULL)
{
ret = this->Main(pConfigFileName);
}
else
{
ret = this->Main(BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE);
}
MAINHELPER_END
return ret;
}
#endif // WIN32
|