[SHELL32][SDK] The SHELL_LINK_HEADER::nIconIndex member is a signed 32-bit integer

This commit is contained in:
Hermès Bélusca-Maïto
2026-05-04 22:02:21 +02:00
parent 442892d14d
commit ba7a6fc7d9
2 changed files with 9 additions and 8 deletions
+5 -4
View File
@@ -1386,7 +1386,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::Extract(PCSTR pszFile, UINT nIconIndex, HI
HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCSTR pszIconPath, INT iIcon)
{
TRACE("(%p)->(path=%s iicon=%u)\n", this, pszIconPath, iIcon);
TRACE("(%p)->(path=%s iicon=%d)\n", this, pszIconPath, iIcon);
LPWSTR str = NULL;
if (pszIconPath)
@@ -1505,7 +1505,6 @@ HRESULT STDMETHODCALLTYPE CShellLink::Resolve(HWND hwnd, DWORD fFlags)
return E_OUTOFMEMORY;
m_Header.nIconIndex = 0;
m_bDirty = TRUE;
}
@@ -1919,7 +1918,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i
HRESULT hr = E_FAIL;
WCHAR szIconPath[MAX_PATH];
TRACE("(%p)->(path=%s iicon=%u)\n", this, debugstr_w(pszIconPath), iIcon);
TRACE("(%p)->(path=%s iicon=%d)\n", this, debugstr_w(pszIconPath), iIcon);
if (pszIconPath)
{
@@ -2799,7 +2798,9 @@ BOOL CShellLink::OnInitDialog(HWND hwndDlg, HWND hwndFocus, LPARAM lParam)
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_ICON, STM_SETICON, (WPARAM)m_hIcon, 0);
}
else
ERR("ExtractIconW failed %ls %u\n", m_sIcoPath, m_Header.nIconIndex);
{
ERR("ExtractIconW failed %ls %d\n", m_sIcoPath, m_Header.nIconIndex);
}
if (!SHGetFileInfoW(m_sLinkPath, 0, &fi, sizeof(fi), SHGFI_DISPLAYNAME))
fi.szDisplayName[0] = UNICODE_NULL;
+4 -4
View File
@@ -1103,12 +1103,12 @@ typedef struct tagSHELL_LINK_HEADER
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeLow; /* only the least significant 32 bits */
/* The index of an icon (signed?) */
DWORD nIconIndex;
DWORD nFileSizeLow; /* Only the least significant 32 bits */
/* The signed icon index */
INT nIconIndex;
/* The expected window state of an application launched by the link */
DWORD nShowCommand;
/* The keystrokes used to launch the application */
/* The hotkey used to launch the application */
WORD wHotKey;
/* Reserved (must be zero) */
WORD wReserved1;