Commit 02db4011 authored by James Forshaw's avatar James Forshaw Committed by Commit Bot

[Win] Statically link SHGetStockIconInfo.

Remove the dynamic linking of SHGetStockIconInfo as the project no longer
supports Windows XP where this was necessary.

Bug: 986625
Change-Id: I89abb16f8089fc475a9930f4f9ea4ad4ea1a71fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726765Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682989}
parent 5b45ceb5
...@@ -31,17 +31,8 @@ SkBitmap GetElevationIcon() { ...@@ -31,17 +31,8 @@ SkBitmap GetElevationIcon() {
return SkBitmap(); return SkBitmap();
SHSTOCKICONINFO icon_info = { sizeof(SHSTOCKICONINFO) }; SHSTOCKICONINFO icon_info = { sizeof(SHSTOCKICONINFO) };
typedef HRESULT (STDAPICALLTYPE *GetStockIconInfo)(SHSTOCKICONID, if (FAILED(SHGetStockIconInfo(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON,
UINT, &icon_info)))
SHSTOCKICONINFO*);
// Even with the runtime guard above, we have to use GetProcAddress()
// here, because otherwise the loader will try to resolve the function
// address on startup, which will break on XP.
GetStockIconInfo func = reinterpret_cast<GetStockIconInfo>(
GetProcAddress(GetModuleHandle(L"shell32.dll"), "SHGetStockIconInfo"));
// TODO(pkasting): Run on a background thread since this call spins a nested
// message loop.
if (FAILED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, &icon_info)))
return SkBitmap(); return SkBitmap();
SkBitmap icon = IconUtil::CreateSkBitmapFromHICON( SkBitmap icon = IconUtil::CreateSkBitmapFromHICON(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment