Author: gadamopoulos
Date: Wed Feb  1 13:31:55 2017
New Revision: 73660

URL: http://svn.reactos.org/svn/reactos?rev=73660&view=rev
Log:
[SHELL32] Implement support for IID_IDropTarget in 
CDesktopFolder::GetUIObjectOf and CDrivesFolder::GetUIObjectOf. Fixes dragging 
items to the icons of My documents, Recycle bin or drive.

Modified:
    trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
    trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp

Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp?rev=73660&r1=73659&r2=73660&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp  [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp  [iso-8859-1] 
Wed Feb  1 13:31:55 2017
@@ -686,6 +686,15 @@
     {
         hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, 
prgfInOut, &pObj);
     }
+    else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
+    {
+        CComPtr<IShellFolder> psfChild;
+        hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, 
&psfChild));
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        return psfChild->CreateViewObject(NULL, riid, ppvOut);
+    }
     else
         hr = E_NOINTERFACE;
 

Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp?rev=73660&r1=73659&r2=73660&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp   [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp   [iso-8859-1] 
Wed Feb  1 13:31:55 2017
@@ -631,11 +631,14 @@
         else
             hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, 
prgfInOut, &pObj);
     }
-    else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
-    {
-        IDropTarget * pDt = NULL;
-        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
-        pObj = pDt;
+    else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
+    {
+        CComPtr<IShellFolder> psfChild;
+        hr = this->BindToObject(apidl[0], NULL, IID_PPV_ARG(IShellFolder, 
&psfChild));
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        return psfChild->CreateViewObject(NULL, riid, ppvOut);
     }
     else
         hr = E_NOINTERFACE;


Reply via email to