https://git.reactos.org/?p=reactos.git;a=commitdiff;h=41639e94c208b4dda7cd4f52af242a417d3c6a69

commit 41639e94c208b4dda7cd4f52af242a417d3c6a69
Author:     Giannis Adamopoulos <[email protected]>
AuthorDate: Sun Nov 11 12:40:45 2018 +0200
Commit:     Giannis Adamopoulos <[email protected]>
CommitDate: Sun Nov 11 20:28:31 2018 +0200

    [NETSHELL] CNetworkConnections: Remove SFGAO_CANRENAME bit when renaming 
shouldn't be enabled.
    This fixes the problem where renaming could take place by clicking on a 
name even when it is disabled in the context menu.
    CORE-14116
---
 dll/shellext/netshell/shfldr_netconnect.cpp | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/dll/shellext/netshell/shfldr_netconnect.cpp 
b/dll/shellext/netshell/shfldr_netconnect.cpp
index cb4d167f81..64b7806e70 100644
--- a/dll/shellext/netshell/shfldr_netconnect.cpp
+++ b/dll/shellext/netshell/shfldr_netconnect.cpp
@@ -401,10 +401,33 @@ HRESULT WINAPI CNetworkConnections::GetAttributesOf(
         *rgfInOut = ~0;
 
     if (cidl == 0)
+    {
         *rgfInOut = dwNetConnectAttributes;
+    }
     else
+    {
         *rgfInOut = dwNetConnectItemAttributes;
 
+        while (cidl > 0 && *apidl)
+        {
+            const VALUEStruct * val;
+            NETCON_PROPERTIES * pProperties;
+
+            val = _ILGetValueStruct(*apidl);
+            if (!val)
+                continue;
+
+            if (val->pItem->GetProperties(&pProperties) != S_OK)
+                continue;
+
+            if (!(pProperties->dwCharacter & NCCF_ALLOW_RENAME))
+                *rgfInOut &= ~SFGAO_CANRENAME;
+
+            apidl++;
+            cidl--;
+        }
+    }
+
     /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
     *rgfInOut &= ~SFGAO_VALIDATE;
 

Reply via email to