Index: reactos/dll/win32/shell32/wine/shell32_main.c =================================================================== --- reactos/dll/win32/shell32/wine/shell32_main.c (revision 75222) +++ reactos/dll/win32/shell32/wine/shell32_main.c (working copy) @@ -3,6 +3,7 @@ * * Copyright 1998 Marcus Meissner * Copyright 1998 Juergen Schmied (jsch) * + * Copyright 2017 Katayama Hirofumi MZ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -433,7 +434,15 @@ { psfi->szDisplayName[0] = '\0'; psfi->szTypeName[0] = '\0'; - psfi->iIcon = 0; + if (flags & SHGFI_ICON) + { + psfi->dwAttributes = 0; + } + if (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX)) + { + psfi->iIcon = 0; + } + psfi->hIcon = NULL; } if (!(flags & SHGFI_PIDL)) @@ -450,13 +459,6 @@ } } - if (flags & SHGFI_EXETYPE) - { - if (flags != SHGFI_EXETYPE) - return 0; - return shgfi_get_exe_type(szFullPath); - } - /* * psfi is NULL normally to query EXE type. If it is NULL, none of the * below makes sense anyway. Windows allows this and just returns FALSE @@ -498,15 +500,19 @@ } /* get the attributes of the child */ - if (SUCCEEDED(hr) && (flags & SHGFI_ATTRIBUTES)) + if (flags & SHGFI_ATTRIBUTES) { - if (!(flags & SHGFI_ATTR_SPECIFIED)) + psfi->dwAttributes = 0; + if (SUCCEEDED(hr)) { - psfi->dwAttributes = 0xffffffff; + if (!(flags & SHGFI_ATTR_SPECIFIED)) + { + psfi->dwAttributes = 0xffffffff; + } + if (psfParent) + IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast, + &(psfi->dwAttributes) ); } - if (psfParent) - IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast, - &(psfi->dwAttributes) ); } /* get the displayname */ @@ -710,6 +716,14 @@ ret = (DWORD_PTR)big_icons; } } + else + { + if (SUCCEEDED(hr) && (flags & SHGFI_EXETYPE)) + { + DWORD type = shgfi_get_exe_type(szFullPath); + ret = (type == 0) ? 1 : type; + } + } /* icon handle */ if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded) @@ -781,15 +795,21 @@ { if(flags & SHGFI_ICON) psfi->hIcon=temppsfi.hIcon; + else + psfi->hIcon = NULL; if(flags & (SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_ICONLOCATION)) - psfi->iIcon=temppsfi.iIcon; + psfi->iIcon = temppsfi.iIcon; if(flags & SHGFI_ATTRIBUTES) psfi->dwAttributes=temppsfi.dwAttributes; + else + psfi->dwAttributes = 0; + psfi->szDisplayName[0] = 0; if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION)) { WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1, psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL); } + psfi->szTypeName[0] = 0; if(flags & SHGFI_TYPENAME) { WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,