Martin Fuchs : shell32: Avoid recursing SHELL32_GetItemAttributes() calls.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 20 05:40:55 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 8167c415ab4e1f80f2d1240edc60a01b9a570845
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=8167c415ab4e1f80f2d1240edc60a01b9a570845

Author: Martin Fuchs <martin-fuchs at gmx.net>
Date:   Mon Feb 20 11:50:56 2006 +0100

shell32: Avoid recursing SHELL32_GetItemAttributes() calls.

---

 dlls/shell32/shlfolder.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c
index e81056b..57bf5f6 100644
--- a/dlls/shell32/shlfolder.c
+++ b/dlls/shell32/shlfolder.c
@@ -425,11 +425,20 @@ HRESULT SHELL32_GetItemAttributes (IShel
 
         if (!dwAttributes && has_guid) {
 	    WCHAR path[MAX_PATH];
+	    STRRET strret;
 
 	    /* File attributes are not present in the internal PIDL structure, so get them from the file system. */
-	    if (SHGetPathFromIDListW(pidl, path))
-		dwAttributes = GetFileAttributesW(path);
-        }
+
+	    HRESULT hr = IShellFolder_GetDisplayNameOf(psf, pidl, SHGDN_FORPARSING, &strret);
+
+	    if (SUCCEEDED(hr)) {
+		hr = StrRetToBufW(&strret, pidl, path, MAX_PATH);
+
+		/* call GetFileAttributes() only for file system paths, not for parsing names like "::{...}" */
+		if (SUCCEEDED(hr) && path[0]!=':')
+		    dwAttributes = GetFileAttributesW(path);
+	    }
+	}
 
         /* Set common attributes */
         *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | 




More information about the wine-cvs mailing list