Potential fix for issue 26, but needs some GUI integration

This commit is contained in:
Nick Bolton 2010-06-05 18:54:51 +00:00
parent 801c3112b1
commit 52564a473a
16 changed files with 423 additions and 26 deletions

View file

@ -615,13 +615,14 @@ CArchDaemonWindows::serviceMain(DWORD argc, LPTSTR* argvIn)
m_serviceState = SERVICE_START_PENDING;
setStatus(m_serviceState, 0, 10000);
std::string commandLine;
// if no arguments supplied then try getting them from the registry.
// the first argument doesn't count because it's the service name.
Arguments args;
ArgList myArgv;
if (argc <= 1) {
// read command line
std::string commandLine;
HKEY key = openNTServicesKey();
key = CArchMiscWindows::openKey(key, argvIn[0]);
key = CArchMiscWindows::openKey(key, _T("Parameters"));
@ -685,6 +686,8 @@ CArchDaemonWindows::serviceMain(DWORD argc, LPTSTR* argvIn)
}
}
m_commandLine = commandLine;
try {
// invoke daemon function
m_daemonResult = m_daemonFunc(static_cast<int>(argc), argv);