https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1faa571f3f0445f46554e…
commit 1faa571f3f0445f46554ebe33bf105a87baeea2e
Author:     Whindmar Saksit <whindsaks(a)proton.me>
AuthorDate: Fri Dec 27 14:47:11 2024 +0100
Commit:     GitHub <noreply(a)github.com>
CommitDate: Fri Dec 27 14:47:11 2024 +0100
    [SHELL32] CM::InvokeCommand case-insensitive compare verb string (#7582)
    CORE-18733
---
 dll/win32/shell32/CDefaultContextMenu.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp
b/dll/win32/shell32/CDefaultContextMenu.cpp
index 90954dd87c9..b076980e7b6 100644
--- a/dll/win32/shell32/CDefaultContextMenu.cpp
+++ b/dll/win32/shell32/CDefaultContextMenu.cpp
@@ -1214,7 +1214,7 @@ CDefaultContextMenu::MapVerbToCmdId(PVOID Verb, PUINT idCmd, BOOL
IsUnicode)
         {
             /* The static verbs are ANSI, get a unicode version before doing the compare
*/
             SHAnsiToUnicode(g_StaticInvokeCmdMap[i].szStringVerb, UnicodeStr, MAX_VERB);
-            if (!wcscmp(UnicodeStr, (LPWSTR)Verb))
+            if (!_wcsicmp(UnicodeStr, (LPWSTR)Verb))
             {
                 /* Return the Corresponding Id */
                 *idCmd = g_StaticInvokeCmdMap[i].IntVerb;
@@ -1223,7 +1223,7 @@ CDefaultContextMenu::MapVerbToCmdId(PVOID Verb, PUINT idCmd, BOOL
IsUnicode)
         }
         else
         {
-            if (!strcmp(g_StaticInvokeCmdMap[i].szStringVerb, (LPSTR)Verb))
+            if (!_stricmp(g_StaticInvokeCmdMap[i].szStringVerb, (LPSTR)Verb))
             {
                 *idCmd = g_StaticInvokeCmdMap[i].IntVerb;
                 return TRUE;
@@ -1527,6 +1527,8 @@ CDefaultContextMenu::InvokeCommand(
         /* Get the ID which corresponds to this verb, and update our local copy */
         if (MapVerbToCmdId((LPVOID)LocalInvokeInfo.lpVerb, &CmdId, FALSE))
             LocalInvokeInfo.lpVerb = MAKEINTRESOURCEA(CmdId);
+        else
+            return E_INVALIDARG;
     }
     CmdId = LOWORD(LocalInvokeInfo.lpVerb);