From: James McDonnell topgamer7@gmail.com
Try to lookup icon information from shell32.dll.
This resolves the issue where in affinity photos installer it would crash because hIcon was returned as 0 --- dlls/shell32/iconcache.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index 8f9519d2ca8..0f690e1987f 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -1004,12 +1004,17 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO sii->iIcon = -IDI_SHELL_FILE; lstrcatW(sii->szPath, L"\shell32.dll");
- if (flags) - FIXME("flags 0x%x not implemented\n", flags); + if (flags & ~SHGSI_ICON) + FIXME("unhandled flags 0x%x\n", flags);
sii->hIcon = NULL; - if (flags & SHGSI_ICON) - sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(sii->iIcon)); + if (flags & SHGSI_ICON) { + sii->hIcon = LoadIconW(GetModuleHandleW(sii->szPath), MAKEINTRESOURCEW(id + 1)); + + if (!sii->hIcon) { + FIXME("Stock icon %d missing.\n", id); + } + } sii->iSysImageIndex = -1;
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);