From 9a85a537311f9ac0b7c150f135672837d2d93597 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 17 Jun 2026 10:02:09 +0900 Subject: [PATCH] Windows: accept 'n' as a disable argument for /protectScreen and /protectMemory --- src/ExpandVolume/WinMain.cpp | 4 ++-- src/Format/Tcformat.c | 4 ++-- src/Mount/Mount.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp index 7a60158a..80c35039 100644 --- a/src/ExpandVolume/WinMain.cpp +++ b/src/ExpandVolume/WinMain.cpp @@ -1119,7 +1119,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz { if (_wcsicmp (argv[i], L"/protectScreen") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling screen protection is only allowed in portable mode if (IsNonInstallMode()) @@ -1132,7 +1132,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } if (_wcsicmp (argv[i], L"/protectMemory") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling memory protection is only allowed in portable mode if (IsNonInstallMode()) diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 9714676b..8aabd17c 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -10663,7 +10663,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz { if (_wcsicmp (argv[i], L"/protectScreen") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling screen protection is only allowed in portable mode if (IsNonInstallMode()) @@ -10676,7 +10676,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } if (_wcsicmp (argv[i], L"/protectMemory") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling memory protection is only allowed in portable mode if (IsNonInstallMode()) diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 0ca79ddb..4b48b3c3 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -11118,7 +11118,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } if (_wcsicmp (argv[i], L"/protectScreen") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling screen protection is only allowed in portable mode if (IsNonInstallMode()) @@ -11131,7 +11131,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } if (_wcsicmp (argv[i], L"/protectMemory") == 0) { - if ((i < argc - 1) && _wcsicmp (argv[i + 1], L"no") == 0) + if ((i < argc - 1) && (_wcsicmp (argv[i + 1], L"no") == 0 || _wcsicmp (argv[i + 1], L"n") == 0)) { // Disabling memory protection is only allowed in portable mode if (IsNonInstallMode())