From 44a23652e2fb7de25dc4bc82ffa6ed2019392516 Mon Sep 17 00:00:00 2001
From: Daniel Lopez <dlope073@gmail.com>
Date: Fri, 24 Apr 2026 16:52:45 -0400
Subject: [PATCH] CORE-20544 Add missing shell command stubs

---
 dll/win32/shell32/shelldesktop/dde.cpp | 35 ++++++++++++++++++++------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/dll/win32/shell32/shelldesktop/dde.cpp b/dll/win32/shell32/shelldesktop/dde.cpp
index 40fefdb0409..0777d0d6dd6 100644
--- a/dll/win32/shell32/shelldesktop/dde.cpp
+++ b/dll/win32/shell32/shelldesktop/dde.cpp
@@ -146,7 +146,6 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
     [ExploreFolder("%l", %I, %S)] -- Open a folder in "explore" mode (file tree is shown to the left by default)
     [FindFolder("%l", %I)]        -- Open a folder in "find" mode (search panel is shown to the left by default)
     [ShellFile("%1","%1",%S)]     -- Execute the contents of the specified .SCF file
-
     Approximate grammar (Upper names define rules, <lower> names define terminals, single-quotes are literals):
 
         Rules
@@ -169,9 +168,12 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
     // Simplified parsing (assumes the command will not be TOO broken):
 
     PWSTR cmd = szCommand;
+    
     //    1. if starts with [, skip first char
-    if (*cmd == L'[')
+    if (*cmd == L'[') 
+    {
         cmd++;
+    }
 
     if (*cmd == L']')
     {
@@ -192,10 +194,14 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
         *cmdEnd = 0;
 
         StringCchCopy(Command, _countof(Command), cmd);
-
+        
         cmd = cmdEnd + 1;
     }
 
+    if (NULL == StrChrW(szCommand, L'\'') && NULL == StrChrW(szCommand, L'\"')) {
+        goto find_command_handler;
+    }
+
     // Read first param after (, expecting quoted string
     if (*cmd != L')')
     {
@@ -234,7 +240,7 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
     {
         if (*cmd != ':')
         {
-            ERR("Expected ':'. Invalid command.\n");
+            ERR("Expected ':'. Invalid command -- %S!\n", Command);
             return DDE_FNOTPROCESSED;
         }
 
@@ -260,6 +266,8 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
         UnknownParameter = StrToIntW(cmd);
     }
 
+find_command_handler:
+
     TRACE("Parse end: cmd=%S, S=%d, pidl=%p, path=%S\n", Command, UnknownParameter, IdList, Path);
 
     // Find handler in list
@@ -414,8 +422,19 @@ static DWORD CALLBACK DDE_OnShellFile(PWSTR strCommand, PWSTR strPath, LPITEMIDL
 
 static DWORD CALLBACK DDE_OnCreateGroup(PWSTR strCommand, PWSTR strPath, LPITEMIDLIST pidl, INT unkS)
 {
-    if (!pidl)
-        pidl = ILCreateFromPathW(strPath);
+    UNIMPLEMENTED;
+    return DDE_FACK;
+}
+
+static DWORD CALLBACK DDE_OnShowGroup(PWSTR strCommand, PWSTR strPath, LPITEMIDLIST pidl, INT unkS)
+{
+    UNIMPLEMENTED;
+    return DDE_FACK;
+}
+
+static DWORD CALLBACK DDE_OnAddItem(PWSTR strCommand, PWSTR strPath, LPITEMIDLIST pidl, INT unkS)
+{
+    UNIMPLEMENTED;
     return DDE_FACK;
 }
 
@@ -425,7 +444,9 @@ DDECommandHandler HandlerList [] = {
         { L"ExploreFolder", DDW_OnExploreFolder },
         { L"FindFolder", DDE_OnFindFolder },
         { L"ShellFile", DDE_OnShellFile },
-        { L"CreateGroup", DDE_OnCreateGroup }
+        { L"CreateGroup", DDE_OnCreateGroup },
+        { L"ShowGroup", DDE_OnShowGroup },
+        { L"AddItem", DDE_OnAddItem }
 };
 
 const int HandlerListLength = _countof(HandlerList);
-- 
2.51.0

