Added a check for desktop in SHGetFileInfo.

This commit is contained in:
Francis Beaudet 1999-03-19 17:04:25 +00:00 committed by Alexandre Julliard
parent b2ad2439ef
commit a76f667d3f
1 changed files with 29 additions and 17 deletions

View File

@ -116,24 +116,36 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if (flags & SHGFI_ATTRIBUTES)
{ if (flags & SHGFI_PIDL)
{ pData = _ILGetDataPointer((LPCITEMIDLIST)path);
switch (pData->type)
{ case PT_DESKTOP:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK;
case PT_MYCOMP:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK ;
case PT_SPECIAL:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CAPABILITYMASK;
case PT_DRIVE:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK;
case PT_FOLDER:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_CAPABILITYMASK;
case PT_VALUE:
psfi->dwAttributes = SFGAO_FILESYSTEM | SFGAO_CAPABILITYMASK;
{
/*
* We have to test for the desktop folder first because ILGetDataPointer returns
* NULL on the desktop folder.
*/
if (_ILIsDesktop((LPCITEMIDLIST)path))
{ psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK;
ret = TRUE;
}
else
{ pData = _ILGetDataPointer((LPCITEMIDLIST)path);
switch (pData->type)
{ case PT_DESKTOP:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK;
case PT_MYCOMP:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | SFGAO_CANLINK ;
case PT_SPECIAL:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CAPABILITYMASK;
case PT_DRIVE:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK;
case PT_FOLDER:
psfi->dwAttributes = SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_CAPABILITYMASK;
case PT_VALUE:
psfi->dwAttributes = SFGAO_FILESYSTEM | SFGAO_CAPABILITYMASK;
}
ret=TRUE;
}
ret=TRUE;
}
else
{ if (! (flags & SHGFI_USEFILEATTRIBUTES))