mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
[USER32] PrivateExtractIcons must return 0 for empty files (#7767)
This bug breaks the documented S_FALSE return value for SHDefExtractIconW when the icon is not found.
This commit is contained in:
parent
d1d300b44b
commit
acbadb9fba
1 changed files with 8 additions and 0 deletions
|
@ -347,6 +347,14 @@ static UINT ICO_ExtractIconExW(
|
||||||
hFile = CreateFileW(szExePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
hFile = CreateFileW(szExePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
||||||
if (hFile == INVALID_HANDLE_VALUE) return ret;
|
if (hFile == INVALID_HANDLE_VALUE) return ret;
|
||||||
fsizel = GetFileSize(hFile,&fsizeh);
|
fsizel = GetFileSize(hFile,&fsizeh);
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
if (!(fsizel | fsizeh))
|
||||||
|
{
|
||||||
|
/* Cannot map empty file */
|
||||||
|
CloseHandle(hFile);
|
||||||
|
return 0; /* No icons */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Map the file */
|
/* Map the file */
|
||||||
fmapping = CreateFileMappingW(hFile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL);
|
fmapping = CreateFileMappingW(hFile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL);
|
||||||
|
|
Loading…
Reference in a new issue