[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
This commit is contained in:
Giannis Adamopoulos 2018-11-11 12:40:45 +02:00
parent 91119080bc
commit 41639e94c2

View file

@ -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;