Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAPPS] Validate DisplayIcon value and support icon index (reactos#5664)
- If the DisplayIcon value points to an invalid path, ExtractIconW() can return 1! ExtractIconExW() does not have this problem nor the -1 issue. Reference: https://devblogs.microsoft.com/oldnewthing/20050526-07/?p=35533 - Use the icon index from PathParseIconLocationW(). Addendum to c6c7fc1. CORE-19317 Test to reproduce: ``` @echo off reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex1 /v DisplayName /d "Ex1 Normal" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex1 /v DisplayIcon /d "%windir%\explorer.exe" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex1 /v UninstallString /d "calc.exe" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex2 /v DisplayName /d "Ex2 Bad icon path" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex2 /v DisplayIcon /d "%windir%\DoesNotExist.exe" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex2 /v UninstallString /d "calc.exe" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex3 /v DisplayName /d "Ex3 Resource index" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex3 /v DisplayIcon /d "%windir%\explorer.exe,4" /f reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ex3 /v UninstallString /d "calc.exe" /f start appwiz.cpl ```
- Loading branch information