Rebase against 975d0632a19efd41338cb73a97f1b0bdbe7bc0cc.

This commit is contained in:
Alistair Leslie-Hughes
2021-09-21 09:08:59 +10:00
parent 2771ab8cee
commit a1db1dfc16
31 changed files with 313 additions and 327 deletions

View File

@@ -1,4 +1,4 @@
From 3c48b07b4aeaf7bfae61c5e43382fd2165ae31bd Mon Sep 17 00:00:00 2001
From 71e2a33c1ecf912c000449971bcbae26a7797c6a Mon Sep 17 00:00:00 2001
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Date: Fri, 12 Oct 2018 11:57:18 +0200
Subject: [PATCH] shell32: Improve semi-stub SHGetStockIconInfo, try find
@@ -13,15 +13,15 @@ Fix for bug https://bugs.winehq.org/show_bug.cgi?id=45868
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
---
dlls/shell32/iconcache.c | 158 +++++++++++++++++++++++++++++++--
dlls/shell32/iconcache.c | 156 +++++++++++++++++++++++++++++++--
dlls/shell32/tests/shelllink.c | 15 ++++
2 files changed, 165 insertions(+), 8 deletions(-)
2 files changed, 164 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
index 6107e0c33b..da3e043d95 100644
index a1c91f4785e..48fc5744879 100644
--- a/dlls/shell32/iconcache.c
+++ b/dlls/shell32/iconcache.c
@@ -987,6 +987,119 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
@@ -1020,6 +1020,119 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
return -1;
}
@@ -141,31 +141,31 @@ index 6107e0c33b..da3e043d95 100644
/****************************************************************************
* SHGetStockIconInfo [SHELL32.@]
*
@@ -1004,25 +1117,54 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
@@ -1037,23 +1150,52 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
*/
HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii)
{
- static const WCHAR shell32dll[] = {'\\','s','h','e','l','l','3','2','.','d','l','l',0};
+ static const WCHAR shell32dllW[] = {'s','h','e','l','l','3','2','.','d','l','l',0};
+ static const WCHAR slashW[] = {'\\',0};
+ HMODULE hmod;
- FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii);
+ HMODULE hmod;
+
+ TRACE("(%d, 0x%x, %p)\n", id, flags, sii);
+
if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) {
return E_INVALIDARG;
}
GetSystemDirectoryW(sii->szPath, MAX_PATH);
+ lstrcatW(sii->szPath, slashW);
+ lstrcatW(sii->szPath, shell32dllW);
+
+ sii->hIcon = NULL;
+ sii->iSysImageIndex = -1;
-
- /* no icons defined: use default */
- sii->iIcon = -IDI_SHELL_FILE;
- lstrcatW(sii->szPath, shell32dll);
lstrcatW(sii->szPath, L"\\shell32.dll");
- if (flags)
- FIXME("flags 0x%x not implemented\n", flags);
-
sii->hIcon = NULL;
sii->iSysImageIndex = -1;
+ /* this is not how windows does it, on windows picked mostly from imageres.dll !*/
+ if (si_table[id].iconid)
+ sii->iIcon = sii->iSysImageIndex - si_table[id].id;
@@ -179,7 +179,7 @@ index 6107e0c33b..da3e043d95 100644
+ {
+ flags &= ~SHGSI_ICON;
+
+ hmod = GetModuleHandleW(shell32dllW);
+ hmod = GetModuleHandleW(L"shell32.dll");
+ if (hmod)
+ {
+ if (si_table[id].iconid)
@@ -194,21 +194,18 @@ index 6107e0c33b..da3e043d95 100644
+ return E_INVALIDARG;
+ }
+ }
if (flags)
FIXME("flags 0x%x not implemented\n", flags);
- sii->hIcon = NULL;
- sii->iSysImageIndex = -1;
-
+
+ if (flags)
+ FIXME("flags 0x%x not implemented\n", flags);
+
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);
return S_OK;
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 3bfd9cbe38..e7e3dac987 100644
index edd536c3a01..05adcae57b2 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -1139,6 +1139,21 @@ static void test_SHGetStockIconInfo(void)
@@ -1073,6 +1073,21 @@ static void test_SHGetStockIconInfo(void)
/* there is a NULL check for the struct */
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, NULL);
ok(hr == E_INVALIDARG, "NULL: got 0x%x\n", hr);
@@ -231,5 +228,5 @@ index 3bfd9cbe38..e7e3dac987 100644
static void test_SHExtractIcons(void)
--
2.19.1
2.33.0