Since LoadIconW returns NULL on an error anyway, we should try LoadIconW. This fixes a crash with the Affinity V2 installers.
-- v5: shell32: check for SHGSI_ICON flag before attempting to load the icon
From: Kieran Geary kieran.r.geary@gmail.com
Since LoadIconW returns NULL on an error anyway, we should try LoadIconW. This fixes a crash with the Affinity V2 installers. --- dlls/shell32/iconcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index c122c145609..eae9cbfd8fe 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -1007,7 +1007,7 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO if (flags) FIXME("flags 0x%x not implemented\n", flags);
- sii->hIcon = NULL; + sii->hIcon = LoadIconW(GetModuleHandleW(L"\shell32.dll"), MAKEINTRESOURCEW(IDI_SHELL_FILE)); sii->iSysImageIndex = -1;
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);
From: Kieran Geary kieran.r.geary@gmail.com
--- dlls/shell32/iconcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index eae9cbfd8fe..936fad1c3e1 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -1007,7 +1007,7 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO if (flags) FIXME("flags 0x%x not implemented\n", flags);
- sii->hIcon = LoadIconW(GetModuleHandleW(L"\shell32.dll"), MAKEINTRESOURCEW(IDI_SHELL_FILE)); + sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(IDI_SHELL_FILE)); sii->iSysImageIndex = -1;
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);
From: Kieran Geary kieran.r.geary@gmail.com
--- dlls/shell32/iconcache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index 936fad1c3e1..99bf504eb39 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -1007,7 +1007,10 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO if (flags) FIXME("flags 0x%x not implemented\n", flags);
- sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(IDI_SHELL_FILE)); + sii->hIcon = NULL; + if (flags & SHGSI_ICON) + sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(IDI_SHELL_FILE)); + sii->iSysImageIndex = -1;
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);