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

This commit is contained in:
Vincent Povirk 2010-07-16 15:36:30 -05:00 committed by Alexandre Julliard
parent 1ebdd6b945
commit 537bfbf494
1 changed files with 3 additions and 3 deletions

View File

@ -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)
{