From ba7a6fc7d9a0fdc76dd82fafca0c9af6ce286529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 4 May 2026 22:02:21 +0200 Subject: [PATCH] [SHELL32][SDK] The SHELL_LINK_HEADER::nIconIndex member is a signed 32-bit integer --- dll/win32/shell32/CShellLink.cpp | 9 +++++---- sdk/include/reactos/undocshell.h | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index bba214cd70e..5c71bda262b 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -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; diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 89e6b8de9ed..8251a6d9bf3 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -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;