From 552a2e20404f4676225da8b49e929c2ba0d7f9bd Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Tue, 7 Jun 2022 19:34:38 +0300 Subject: [PATCH] General: Fixed a bug that could prevent Control Panel link redirection from working correctly --- ExplorerPatcher/dllmain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 1b48ac2..ad26d1f 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -7863,14 +7863,18 @@ int ExplorerFrame_CompareStringOrdinal(const WCHAR* a1, int a2, const WCHAR* a3, NULL }; int ret = CompareStringOrdinal(a1, a2, a3, a4, bIgnoreCase); - if ((!bDoNotRedirectSystemToSettingsApp && !bDoNotRedirectProgramsAndFeaturesToSettingsApp) || ret != CSTR_EQUAL) + if (ret != CSTR_EQUAL) { return ret; } int i = 0; - while (CompareStringOrdinal(a3, -1, pRedirects[i], -1, FALSE) != CSTR_EQUAL) + while (1) { + BOOL bCond = FALSE; + if (i == 0) bCond = bDoNotRedirectSystemToSettingsApp; + else if (i == 1) bCond = bDoNotRedirectProgramsAndFeaturesToSettingsApp; + if (CompareStringOrdinal(a3, -1, pRedirects[i], -1, FALSE) == CSTR_EQUAL && bCond) break; i++; if (pRedirects[i] == NULL) {