30 lines
617 B
C++
30 lines
617 B
C++
#pragma once
|
|
|
|
#include "RegistryConfig.h"
|
|
#include <windows.h>
|
|
#include <string>
|
|
|
|
namespace hook
|
|
{
|
|
class ProcessLauncher
|
|
{
|
|
public:
|
|
ProcessLauncher() = default;
|
|
~ProcessLauncher();
|
|
|
|
ProcessLauncher(const ProcessLauncher&) = delete;
|
|
ProcessLauncher& operator=(const ProcessLauncher&) = delete;
|
|
|
|
bool Start(const HookConfig& config);
|
|
void Stop(bool loggingEnabled);
|
|
void Detach(bool loggingEnabled);
|
|
bool IsRunning();
|
|
|
|
private:
|
|
HANDLE process_ = nullptr;
|
|
DWORD processId_ = 0;
|
|
|
|
void CleanupExitedProcess();
|
|
};
|
|
}
|