[PATCH] Add IShellFolderView::GetSelectedObjects implementation for IShellView

Nikolay Sivov nsivov at codeweavers.com
Sun Mar 21 17:32:02 CDT 2010


---
 dlls/shell32/shlview.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index d4247eb..a2db4b6 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -3062,8 +3062,21 @@ static HRESULT WINAPI IShellFolderView_fnGetSelectedObjects(
     UINT *items)
 {
     IShellViewImpl *This = impl_from_IShellFolderView(iface);
-    FIXME("(%p)->(%p %p) stub\n", This, pidl, items);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p %p)\n", This, pidl, items);
+
+    *items = ShellView_GetSelections( This );
+
+    if (*items)
+    {
+        *pidl = LocalAlloc(0, *items*sizeof(LPITEMIDLIST));
+        if (!*pidl) return E_OUTOFMEMORY;
+
+        /* it's documented that caller shouldn't PIDLs, only array itself */
+        memcpy((PITEMID_CHILD*)*pidl, This->apidl, *items*sizeof(LPITEMIDLIST));
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI IShellFolderView_fnIsDropOnSource(
-- 
1.5.6.5


--=-dgSFlqy0MK0vortYfjrq--




More information about the wine-patches mailing list