Commit a76f667d authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard

Added a check for desktop in SHGetFileInfo.

parent b2ad2439
......@@ -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))
......
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