Commit 537bfbf4 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

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

parent 1ebdd6b9
...@@ -436,7 +436,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -436,7 +436,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
/* get the displayname */ /* get the displayname */
if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME)) if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME))
{ {
if (flags & SHGFI_USEFILEATTRIBUTES) if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
{ {
lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath)); lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath));
} }
...@@ -455,7 +455,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -455,7 +455,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
static const WCHAR szFile[] = { 'F','i','l','e',0 }; static const WCHAR szFile[] = { 'F','i','l','e',0 };
static const WCHAR szDashFile[] = { '-','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]; char ftype[80];
...@@ -508,7 +508,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -508,7 +508,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{ {
UINT uDummy,uFlags; UINT uDummy,uFlags;
if (flags & SHGFI_USEFILEATTRIBUTES) if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL))
{ {
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment