Require explicit opt-in to enable process injection on windows

* This option (in spite of large warnings) continues to be a pitfall for new and
  experienced users alike, trying to use process injection without good reason
  and getting into trouble when it breaks.
This commit is contained in:
baldurk
2021-05-24 16:51:43 +01:00
parent 399f1c59e0
commit 2ddf567fec
5 changed files with 63 additions and 5 deletions
+5 -1
View File
@@ -115,7 +115,11 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
setProperty("ICaptureContext", QVariant::fromValue((void *)&ctx));
#if !defined(Q_OS_WIN32)
#if defined(Q_OS_WIN32)
// remove inject menu item when it's not enabled in the settings
if(!ctx.Config().AllowProcessInject)
ui->menu_File->removeAction(ui->action_Inject_into_Process);
#else
// process injection is not supported on non-Windows, so remove the menu item rather than disable
// it without a clear way to communicate that it is never supported
ui->menu_File->removeAction(ui->action_Inject_into_Process);