Fixed crash in winamp reported by Andreas Mohr.
This commit is contained in:
parent
799e6ce629
commit
7cf87c521e
|
@ -476,9 +476,14 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
SHFILEINFOA temppsfi;
|
SHFILEINFOA temppsfi;
|
||||||
|
|
||||||
len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
|
if (flags & SHGFI_PIDL) {
|
||||||
temppath = HeapAlloc(GetProcessHeap(), 0, len);
|
/* path contains a pidl */
|
||||||
WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
|
temppath = (LPSTR) path;
|
||||||
|
} else {
|
||||||
|
len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
|
||||||
|
temppath = HeapAlloc(GetProcessHeap(), 0, len);
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if(flags & SHGFI_ATTR_SPECIFIED)
|
if(flags & SHGFI_ATTR_SPECIFIED)
|
||||||
temppsfi.dwAttributes=psfi->dwAttributes;
|
temppsfi.dwAttributes=psfi->dwAttributes;
|
||||||
|
@ -496,8 +501,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
if(flags & SHGFI_TYPENAME)
|
if(flags & SHGFI_TYPENAME)
|
||||||
MultiByteToWideChar(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName));
|
MultiByteToWideChar(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName));
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, temppath);
|
if(!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue