Nikolay Sivov : shell32: Implement ParseName() using shellfolder API.

Alexandre Julliard julliard at winehq.org
Wed Sep 27 17:54:49 CDT 2017


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Sep 27 11:13:44 2017 +0300

shell32: Implement ParseName() using shellfolder API.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/shelldispatch.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 644f67be..3763ff8 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -1502,31 +1502,25 @@ static HRESULT WINAPI FolderImpl_Items(Folder3 *iface, FolderItems **ppid)
 static HRESULT WINAPI FolderImpl_ParseName(Folder3 *iface, BSTR name, FolderItem **item)
 {
     FolderImpl *This = impl_from_Folder(iface);
-    FolderItem *self;
-    BSTR str;
     WCHAR pathW[MAX_PATH];
+    LPITEMIDLIST pidl;
+    STRRET strret;
     HRESULT hr;
 
     TRACE("(%p,%s,%p)\n", iface, debugstr_w(name), item);
 
     *item = NULL;
 
-    if (!name || !name[0])
+    if (FAILED(IShellFolder2_ParseDisplayName(This->folder, NULL, NULL, name, NULL, &pidl, NULL)))
         return S_FALSE;
 
-    hr = Folder3_get_Self(iface, &self);
+    hr = IShellFolder2_GetDisplayNameOf(This->folder, pidl, SHGDN_FORPARSING, &strret);
+    ILFree(pidl);
     if (FAILED(hr))
-        return hr;
-
-    hr = FolderItem_get_Path(self, &str);
-    FolderItem_Release(self);
-
-    PathCombineW(pathW, str, name);
-    SysFreeString(str);
-
-    if (!PathFileExistsW(pathW))
         return S_FALSE;
 
+    StrRetToBufW(&strret, NULL, pathW, sizeof(pathW)/sizeof(*pathW));
+
     return FolderItem_Constructor(This, pathW, item);
 }
 




More information about the wine-cvs mailing list