- Fixed typo in SHGetFileInfoA.
- Properly convert return values back to Unicode in SHGetFileInfoW.
This commit is contained in:
parent
eaa53a05b0
commit
d7e284781e
|
@ -209,7 +209,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
||||||
SHFILEINFOA *psfi, UINT sizeofpsfi,
|
SHFILEINFOA *psfi, UINT sizeofpsfi,
|
||||||
UINT flags )
|
UINT flags )
|
||||||
{
|
{
|
||||||
char szLoaction[MAX_PATH];
|
char szLocation[MAX_PATH];
|
||||||
int iIndex;
|
int iIndex;
|
||||||
DWORD ret = TRUE, dwAttributes = 0;
|
DWORD ret = TRUE, dwAttributes = 0;
|
||||||
IShellFolder * psfParent = NULL;
|
IShellFolder * psfParent = NULL;
|
||||||
|
@ -375,11 +375,11 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = IExtractIconA_GetIconLocation(pei, (flags & SHGFI_OPENICON)? GIL_OPENICON : 0,szLoaction, MAX_PATH, &iIndex, &uFlags);
|
hr = IExtractIconA_GetIconLocation(pei, (flags & SHGFI_OPENICON)? GIL_OPENICON : 0,szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||||
/* FIXME what to do with the index? */
|
/* FIXME what to do with the index? */
|
||||||
|
|
||||||
if(uFlags != GIL_NOTFILENAME)
|
if(uFlags != GIL_NOTFILENAME)
|
||||||
strcpy (psfi->szDisplayName, szLoaction);
|
strcpy (psfi->szDisplayName, szLocation);
|
||||||
else
|
else
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
|
||||||
|
@ -480,13 +480,22 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
temppath = HeapAlloc(GetProcessHeap(), 0, len);
|
temppath = HeapAlloc(GetProcessHeap(), 0, len);
|
||||||
WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, psfi->szDisplayName, -1, temppsfi.szDisplayName,
|
if(flags & SHGFI_ATTR_SPECIFIED)
|
||||||
sizeof(temppsfi.szDisplayName), NULL, NULL);
|
temppsfi.dwAttributes=psfi->dwAttributes;
|
||||||
WideCharToMultiByte(CP_ACP, 0, psfi->szTypeName, -1, temppsfi.szTypeName,
|
|
||||||
sizeof(temppsfi.szTypeName), NULL, NULL);
|
|
||||||
|
|
||||||
ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
|
ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
|
||||||
|
|
||||||
|
if(flags & SHGFI_ICON)
|
||||||
|
psfi->hIcon=temppsfi.hIcon;
|
||||||
|
if(flags & (SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_ICONLOCATION))
|
||||||
|
psfi->iIcon=temppsfi.iIcon;
|
||||||
|
if(flags & SHGFI_ATTRIBUTES)
|
||||||
|
psfi->dwAttributes=temppsfi.dwAttributes;
|
||||||
|
if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION))
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, temppsfi.szDisplayName, -1, psfi->szDisplayName, sizeof(psfi->szDisplayName));
|
||||||
|
if(flags & SHGFI_TYPENAME)
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName));
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, temppath);
|
HeapFree(GetProcessHeap(), 0, temppath);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue