chore: Cleanup windows includes
This commit is contained in:
parent
da06e97521
commit
a31cff0225
11 changed files with 15 additions and 18 deletions
|
|
@ -12,7 +12,9 @@
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
#include "arch/win32/ArchMiscWindows.h"
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
|
#include "common/Constants.h"
|
||||||
|
|
||||||
|
inline static const auto kDefaultDaemonName = _T(kAppName);
|
||||||
//
|
//
|
||||||
// ArchDaemonWindows
|
// ArchDaemonWindows
|
||||||
//
|
//
|
||||||
|
|
@ -604,17 +606,17 @@ void ArchDaemonWindows::stop(const char *name)
|
||||||
void ArchDaemonWindows::installDaemon()
|
void ArchDaemonWindows::installDaemon()
|
||||||
{
|
{
|
||||||
// install default daemon if not already installed.
|
// install default daemon if not already installed.
|
||||||
if (!isDaemonInstalled(DEFAULT_DAEMON_NAME)) {
|
if (!isDaemonInstalled(kDefaultDaemonName)) {
|
||||||
char binPath[MAX_PATH];
|
char binPath[MAX_PATH];
|
||||||
GetModuleFileName(ArchMiscWindows::instanceWin32(), binPath, MAX_PATH);
|
GetModuleFileName(ArchMiscWindows::instanceWin32(), binPath, MAX_PATH);
|
||||||
|
|
||||||
// wrap in quotes so a malicious user can't start \Program.exe as admin.
|
// wrap in quotes so a malicious user can't start \Program.exe as admin.
|
||||||
const auto command = "\"" + std::string(binPath) + "\"";
|
const auto command = "\"" + std::string(binPath) + "\"";
|
||||||
|
|
||||||
installDaemon(DEFAULT_DAEMON_NAME, DEFAULT_DAEMON_INFO, command.c_str(), "", "");
|
installDaemon(kDefaultDaemonName, DEFAULT_DAEMON_INFO, command.c_str(), "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
start(DEFAULT_DAEMON_NAME);
|
start(kDefaultDaemonName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchDaemonWindows::uninstallDaemon()
|
void ArchDaemonWindows::uninstallDaemon()
|
||||||
|
|
@ -628,7 +630,7 @@ void ArchDaemonWindows::uninstallDaemon()
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove new service if installed.
|
// remove new service if installed.
|
||||||
if (isDaemonInstalled(DEFAULT_DAEMON_NAME)) {
|
if (isDaemonInstalled(kDefaultDaemonName)) {
|
||||||
uninstallDaemon(DEFAULT_DAEMON_NAME);
|
uninstallDaemon(kDefaultDaemonName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "arch/IArchDaemon.h"
|
#include "arch/IArchDaemon.h"
|
||||||
#include "arch/IArchMultithread.h"
|
#include "arch/IArchMultithread.h"
|
||||||
#include "common/Constants.h"
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
@ -77,7 +76,7 @@ public:
|
||||||
int daemonize(const char *name, DaemonFunc const &func) override;
|
int daemonize(const char *name, DaemonFunc const &func) override;
|
||||||
bool canInstallDaemon(const char *name) override;
|
bool canInstallDaemon(const char *name) override;
|
||||||
bool isDaemonInstalled(const char *name) override;
|
bool isDaemonInstalled(const char *name) override;
|
||||||
std::string commandLine() const
|
std::string commandLine() const override
|
||||||
{
|
{
|
||||||
return m_commandLine;
|
return m_commandLine;
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +135,6 @@ private:
|
||||||
std::string m_commandLine;
|
std::string m_commandLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEFAULT_DAEMON_NAME _T(kAppName)
|
|
||||||
#define DEFAULT_DAEMON_INFO _T("Runs the Core process on secure desktops (UAC prompts, login screen, etc).")
|
#define DEFAULT_DAEMON_INFO _T("Runs the Core process on secure desktops (UAC prompts, login screen, etc).")
|
||||||
|
|
||||||
#define LEGACY_SERVER_DAEMON_NAME _T("Deskflow Server")
|
#define LEGACY_SERVER_DAEMON_NAME _T("Deskflow Server")
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "arch/win32/ArchLogWindows.h"
|
#include "arch/win32/ArchLogWindows.h"
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
|
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
#include "arch/win32/ArchMiscWindows.h"
|
||||||
|
|
||||||
#include "arch/XArch.h"
|
|
||||||
#include "arch/win32/ArchDaemonWindows.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"
|
||||||
|
#include "common/Constants.h"
|
||||||
|
|
||||||
#include <Psapi.h>
|
#include <Psapi.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "arch/win32/ArchNetworkWinsock.h"
|
|
||||||
#include "base/String.h"
|
#include "base/String.h"
|
||||||
|
|
||||||
std::string windowsErrorToString(DWORD error)
|
std::string windowsErrorToString(DWORD error)
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/IEventQueue.h"
|
#include "base/IEventQueue.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
|
#include "common/Constants.h"
|
||||||
#include "platform/MSWindowsDesks.h"
|
#include "platform/MSWindowsDesks.h"
|
||||||
#include "platform/MSWindowsHandle.h"
|
#include "platform/MSWindowsHandle.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,17 @@
|
||||||
|
|
||||||
#include "MSWindowsProcess.h"
|
#include "MSWindowsProcess.h"
|
||||||
|
|
||||||
#include "arch/XArch.h"
|
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
|
#include "common/Common.h"
|
||||||
|
#include "common/Constants.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
#include <UserEnv.h>
|
#include <UserEnv.h>
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace deskflow::platform {
|
namespace deskflow::platform {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
#include "deskflow/Clipboard.h"
|
#include "deskflow/Clipboard.h"
|
||||||
#include "deskflow/KeyMap.h"
|
#include "deskflow/KeyMap.h"
|
||||||
#include "deskflow/XScreen.h"
|
#include "deskflow/XScreen.h"
|
||||||
#include "mt/Thread.h"
|
|
||||||
#include "platform/MSWindowsClipboard.h"
|
#include "platform/MSWindowsClipboard.h"
|
||||||
#include "platform/MSWindowsDesks.h"
|
#include "platform/MSWindowsDesks.h"
|
||||||
#include "platform/MSWindowsEventQueueBuffer.h"
|
#include "platform/MSWindowsEventQueueBuffer.h"
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
#include "deskflow/ClientArgs.h"
|
#include "deskflow/ClientArgs.h"
|
||||||
#include "deskflow/PlatformScreen.h"
|
#include "deskflow/PlatformScreen.h"
|
||||||
#include "mt/CondVar.h"
|
|
||||||
#include "mt/Mutex.h"
|
|
||||||
#include "platform/MSWindowsHook.h"
|
#include "platform/MSWindowsHook.h"
|
||||||
#include "platform/MSWindowsPowerManager.h"
|
#include "platform/MSWindowsPowerManager.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,11 @@
|
||||||
|
|
||||||
#include "platform/MSWindowsSession.h"
|
#include "platform/MSWindowsSession.h"
|
||||||
|
|
||||||
#include "arch/XArch.h"
|
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
#include "deskflow/XDeskflow.h"
|
|
||||||
|
|
||||||
#include <Wtsapi32.h>
|
#include <Wtsapi32.h>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
MSWindowsSession::MSWindowsSession() : m_activeSessionId(-1)
|
MSWindowsSession::MSWindowsSession() : m_activeSessionId(-1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@
|
||||||
#include "platform/MSWindowsWatchdog.h"
|
#include "platform/MSWindowsWatchdog.h"
|
||||||
|
|
||||||
#include "arch/Arch.h"
|
#include "arch/Arch.h"
|
||||||
#include "arch/XArch.h"
|
|
||||||
#include "arch/win32/XArchWindows.h"
|
#include "arch/win32/XArchWindows.h"
|
||||||
#include "base/ELevel.h"
|
#include "base/ELevel.h"
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
#include "base/LogOutputters.h"
|
#include "base/LogOutputters.h"
|
||||||
#include "base/TMethodJob.h"
|
#include "base/TMethodJob.h"
|
||||||
|
#include "common/Constants.h"
|
||||||
#include "deskflow/App.h"
|
#include "deskflow/App.h"
|
||||||
#include "mt/Thread.h"
|
#include "mt/Thread.h"
|
||||||
#include "platform/MSWindowsHandle.h"
|
#include "platform/MSWindowsHandle.h"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue