Vincent Povirk : shell32: Don' t access szFullPath when SHGFI_PIDL is set in SHGetFileInfo.

Alexandre Julliard julliard at winehq.org
Mon Jul 19 11:05:30 CDT 2010


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Fri Jul 16 15:36:30 2010 -0500

shell32: Don't access szFullPath when SHGFI_PIDL is set in SHGetFileInfo.

---

 dlls/shell32/shell32_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c
index 2824268..75b9c7e 100644
--- a/dlls/shell32/shell32_main.c
+++ b/dlls/shell32/shell32_main.c
@@ -436,7 +436,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     /* get the displayname */
     if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME))
     {
-        if (flags & SHGFI_USEFILEATTRIBUTES)
+        if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
         {
             lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath));
         }
@@ -455,7 +455,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
         static const WCHAR szFile[] = { 'F','i','l','e',0 };
         static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
 
-        if (!(flags & SHGFI_USEFILEATTRIBUTES))
+        if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL))
         {
             char ftype[80];
 
@@ -508,7 +508,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     {
         UINT uDummy,uFlags;
 
-        if (flags & SHGFI_USEFILEATTRIBUTES)
+        if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
         {
             if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
             {




More information about the wine-cvs mailing list