aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/barrier/win32
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/barrier/win32')
-rw-r--r--src/lib/barrier/win32/AppUtilWindows.cpp28
-rw-r--r--src/lib/barrier/win32/AppUtilWindows.h6
-rw-r--r--src/lib/barrier/win32/DaemonApp.cpp25
-rw-r--r--src/lib/barrier/win32/DaemonApp.h6
4 files changed, 32 insertions, 33 deletions
diff --git a/src/lib/barrier/win32/AppUtilWindows.cpp b/src/lib/barrier/win32/AppUtilWindows.cpp
index 560b029..b19cf15 100644
--- a/src/lib/barrier/win32/AppUtilWindows.cpp
+++ b/src/lib/barrier/win32/AppUtilWindows.cpp
@@ -2,11 +2,11 @@
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2002 Chris Schoeneman
- *
+ *
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
- *
+ *
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -60,13 +60,13 @@ BOOL WINAPI AppUtilWindows::consoleHandler(DWORD)
}
static
-int
-mainLoopStatic()
+int
+mainLoopStatic()
{
return AppUtil::instance().app().mainLoop();
}
-int
+int
AppUtilWindows::daemonNTMainLoop(int argc, const char** argv)
{
app().initApp(argc, argv);
@@ -74,11 +74,11 @@ AppUtilWindows::daemonNTMainLoop(int argc, const char** argv)
// NB: what the hell does this do?!
app().argsBase().m_backend = false;
-
+
return ArchMiscWindows::runDaemon(mainLoopStatic);
}
-void
+void
AppUtilWindows::exitApp(int code)
{
switch (m_exitMode) {
@@ -97,7 +97,7 @@ int daemonNTMainLoopStatic(int argc, const char** argv)
return AppUtilWindows::instance().daemonNTMainLoop(argc, argv);
}
-int
+int
AppUtilWindows::daemonNTStartup(int, char**)
{
SystemLogger sysLogger(app().daemonName(), false);
@@ -126,7 +126,7 @@ AppUtilWindows::beforeAppExit()
// a new console window, and will normally close on exit (making it so
// that we can't see error messages).
if (app().argsBase().m_pauseOnExit) {
- std::cout << std::endl << "press any key to exit..." << std::endl;
+ std::cout << "\n" << "press any key to exit...\n";
int c = _getch();
}
}
@@ -155,13 +155,13 @@ AppUtilWindows::run(int argc, char** argv)
return app().runInner(argc, argv, NULL, startup);
}
-AppUtilWindows&
+AppUtilWindows&
AppUtilWindows::instance()
{
return (AppUtilWindows&)AppUtil::instance();
}
-void
+void
AppUtilWindows::debugServiceWait()
{
if (app().argsBase().m_debugServiceWait)
@@ -169,8 +169,8 @@ AppUtilWindows::debugServiceWait()
while(true)
{
// this code is only executed when the process is launched via the
- // windows service controller (and --debug-service-wait arg is
- // used). to debug, set a breakpoint on this line so that
+ // windows service controller (and --debug-service-wait arg is
+ // used). to debug, set a breakpoint on this line so that
// execution is delayed until the debugger is attached.
ARCH->sleep(1);
LOG((CLOG_INFO "waiting for debugger to attach"));
@@ -178,7 +178,7 @@ AppUtilWindows::debugServiceWait()
}
}
-void
+void
AppUtilWindows::startNode()
{
app().startNode();
diff --git a/src/lib/barrier/win32/AppUtilWindows.h b/src/lib/barrier/win32/AppUtilWindows.h
index c5da228..23e7919 100644
--- a/src/lib/barrier/win32/AppUtilWindows.h
+++ b/src/lib/barrier/win32/AppUtilWindows.h
@@ -2,11 +2,11 @@
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2002 Chris Schoeneman
- *
+ *
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
- *
+ *
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -39,7 +39,7 @@ public:
virtual ~AppUtilWindows();
int daemonNTStartup(int, char**);
-
+
int daemonNTMainLoop(int argc, const char** argv);
void debugServiceWait();
diff --git a/src/lib/barrier/win32/DaemonApp.cpp b/src/lib/barrier/win32/DaemonApp.cpp
index 482c465..81ec5ff 100644
--- a/src/lib/barrier/win32/DaemonApp.cpp
+++ b/src/lib/barrier/win32/DaemonApp.cpp
@@ -2,11 +2,11 @@
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2012 Nick Bolton
- *
+ *
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
- *
+ *
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -28,7 +28,6 @@
#include "net/SocketMultiplexer.h"
#include "arch/XArch.h"
#include "base/Log.h"
-#include "base/TMethodJob.h"
#include "base/TMethodEventJob.h"
#include "base/EventQueue.h"
#include "base/log_outputters.h"
@@ -87,7 +86,7 @@ DaemonApp::run(int argc, char** argv)
{
// win32 instance needed for threading, etc.
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
-
+
Arch arch;
arch.init();
@@ -174,7 +173,7 @@ DaemonApp::mainLoop(bool daemonized)
try
{
DAEMON_RUNNING(true);
-
+
if (daemonized) {
m_fileLogOutputter = new FileLogOutputter(logFilename().c_str());
CLOG->insert(m_fileLogOutputter);
@@ -190,19 +189,19 @@ DaemonApp::mainLoop(bool daemonized)
// send logging to gui via ipc, log system adopts outputter.
m_ipcLogOutputter = new IpcLogOutputter(*m_ipcServer, kIpcClientGui, true);
CLOG->insert(m_ipcLogOutputter);
-
+
m_watchdog = new MSWindowsWatchdog(daemonized, false, *m_ipcServer, *m_ipcLogOutputter);
m_watchdog->setFileLogOutputter(m_fileLogOutputter);
-
+
m_events->adoptHandler(
m_events->forIpcServer().messageReceived(), m_ipcServer,
new TMethodEventJob<DaemonApp>(this, &DaemonApp::handleIpcMessage));
m_ipcServer->listen();
-
+
// install the platform event queue to handle service stop events.
m_events->adoptBuffer(new MSWindowsEventQueueBuffer(m_events));
-
+
String command = ARCH->setting("Command");
bool elevate = ARCH->setting("Elevate") == "1";
if (command != "") {
@@ -219,11 +218,11 @@ DaemonApp::mainLoop(bool daemonized)
m_events->removeHandler(
m_events->forIpcServer().messageReceived(), m_ipcServer);
-
+
CLOG->remove(m_ipcLogOutputter);
delete m_ipcLogOutputter;
delete m_ipcServer;
-
+
DAEMON_RUNNING(false);
}
catch (std::exception& e) {
@@ -245,7 +244,7 @@ DaemonApp::logFilename()
{
string logFilename = ARCH->setting("LogFilename");
if (logFilename.empty())
- logFilename = DataDirectories::global() + "\\" + LOG_FILENAME;
+ logFilename = (barrier::DataDirectories::global() / LOG_FILENAME).u8string();
MSWindowsUtil::createDirectory(logFilename, true);
return logFilename;
}
@@ -287,7 +286,7 @@ DaemonApp::handleIpcMessage(const Event& e, void*)
}
delete[] argv;
-
+
String logLevel(argBase->m_logFilter);
if (!logLevel.empty()) {
try {
diff --git a/src/lib/barrier/win32/DaemonApp.h b/src/lib/barrier/win32/DaemonApp.h
index 2a8484b..e0eb385 100644
--- a/src/lib/barrier/win32/DaemonApp.h
+++ b/src/lib/barrier/win32/DaemonApp.h
@@ -2,11 +2,11 @@
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2012 Nick Bolton
- *
+ *
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
- *
+ *
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+
#pragma once
#include "arch/Arch.h"