Nikolay Sivov : shell32: Simplify Verbs() method.

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


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

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

shell32: Simplify Verbs() method.

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

---

 dlls/shell32/shelldispatch.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 148c45f..3ff9ff0 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -577,6 +577,8 @@ static HRESULT FolderItemVerbs_Constructor(BSTR path, FolderItemVerbs **verbs)
     LPITEMIDLIST pidl;
     HRESULT hr;
 
+    *verbs = NULL;
+
     This = HeapAlloc(GetProcessHeap(), 0, sizeof(FolderItemVerbsImpl));
     if (!This)
         return E_OUTOFMEMORY;
@@ -865,23 +867,14 @@ static HRESULT WINAPI FolderItemImpl_get_Type(FolderItem2 *iface, BSTR *pbs)
 
 static HRESULT WINAPI FolderItemImpl_Verbs(FolderItem2 *iface, FolderItemVerbs **verbs)
 {
-    HRESULT hr;
-    BSTR path;
+    FolderItemImpl *This = impl_from_FolderItem(iface);
 
     TRACE("(%p, %p)\n", iface, verbs);
 
     if (!verbs)
         return E_INVALIDARG;
 
-    *verbs = NULL;
-
-    hr = FolderItem2_get_Path(iface, &path);
-    if (FAILED(hr))
-        return hr;
-
-    hr = FolderItemVerbs_Constructor(path, verbs);
-    SysFreeString(path);
-    return hr;
+    return FolderItemVerbs_Constructor(This->path ? This->path : This->folder->path, verbs);
 }
 
 static HRESULT WINAPI FolderItemImpl_InvokeVerb(FolderItem2 *iface,




More information about the wine-cvs mailing list