From 9b9325fbd107688ded0a6e2f3c7e1c8035a9e025 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Wed, 18 Feb 2009 12:32:00 -0600 Subject: [PATCH] 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 95d5b1a2324..f3534d155a5 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 53964a7dd1a..d16b35da5f0 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; +}