Vincent Povirk : shell32: Partially implement SHCreateShellItem.

Alexandre Julliard julliard at winehq.org
Tue Feb 24 10:21:41 CST 2009


Module: wine
Branch: master
Commit: 9b9325fbd107688ded0a6e2f3c7e1c8035a9e025
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9b9325fbd107688ded0a6e2f3c7e1c8035a9e025

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Feb 18 12:32:00 2009 -0600

shell32: Partially implement SHCreateShellItem.

---

 dlls/shell32/pidl.c      |    7 -------
 dlls/shell32/shellitem.c |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index 95d5b1a..f3534d1 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -2369,10 +2369,3 @@ LPITEMIDLIST* _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, const CIDA * cida)
 
     return dst;
 }
-
-HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
-    IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi)
-{
-    FIXME("STUB: %p %p %p %p\n",pidlParent, psfParent, pidl, ppsi);
-    return E_NOINTERFACE;
-}
diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
index 53964a7..d16b35d 100644
--- a/dlls/shell32/shellitem.c
+++ b/dlls/shell32/shellitem.c
@@ -174,3 +174,38 @@ HRESULT WINAPI IShellItem_Constructor(IUnknown *pUnkOuter, REFIID riid, void **p
 
     return ret;
 }
+
+HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
+    IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi)
+{
+    ShellItem *This;
+    LPITEMIDLIST new_pidl;
+    HRESULT ret;
+
+    TRACE("(%p,%p,%p,%p)\n", pidlParent, psfParent, pidl, ppsi);
+
+    if (!pidlParent && !psfParent && pidl)
+    {
+        new_pidl = ILClone(pidl);
+        if (!new_pidl)
+            return E_OUTOFMEMORY;
+    }
+    else
+    {
+        FIXME("(%p,%p,%p) not implemented\n", pidlParent, psfParent, pidl);
+        return E_NOINTERFACE;
+    }
+
+    ret = IShellItem_Constructor(NULL, &IID_IShellItem, (void**)&This);
+    if (This)
+    {
+        *ppsi = (IShellItem*)This;
+        This->pidl = new_pidl;
+    }
+    else
+    {
+        *ppsi = NULL;
+        ILFree(new_pidl);
+    }
+    return ret;
+}




More information about the wine-cvs mailing list