[NETSHELL] CNetworkConnections: SetNameOf should always return a new pidl on success.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 11 Nov 2018 10:29:20 +0000 (12:29 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 11 Nov 2018 18:28:29 +0000 (20:28 +0200)
CORE-14116

dll/shellext/netshell/shfldr_netconnect.cpp

index d293edb..cb4d167 100644 (file)
@@ -534,6 +534,7 @@ HRESULT WINAPI CNetworkConnections::SetNameOf (
                LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD * pPidlOut)
 {
     const VALUEStruct * val;
+    HRESULT hr;
 
     val = _ILGetValueStruct(pidl);
     if (!val)
@@ -542,7 +543,14 @@ HRESULT WINAPI CNetworkConnections::SetNameOf (
    if (!val->pItem)
        return E_FAIL;
 
-    return val->pItem->Rename(lpName);
+    hr = val->pItem->Rename(lpName);
+    if (FAILED(hr))
+        return hr;
+
+    /* The pidl hasn't changed */
+    *pPidlOut = ILClone(pidl);
+
+    return S_OK;
 }
 
 HRESULT WINAPI CNetworkConnections::GetDefaultSearchGUID(GUID * pguid)