Skip to content

Commit d69a80f

Browse files
authored
[SHDOCVW] Follow-up of reactos#7804: Improve AddUrlToFavorites (reactos#7820)
JIRA issue: CORE-19824 JIRA issue: CORE-19867 JIRA issue: CORE-14172 - Use <strsafe.h>. - Don't use CSIDL_COMMON_FAVORITES.
1 parent 457642c commit d69a80f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dll/win32/shdocvw/utility.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
44
* PURPOSE: Utility routines
55
* COPYRIGHT: Copyright 2024 Whindmar Saksit <[email protected]>
6+
* Copyright 2025 Katayama Hirofumi MZ <[email protected]>
67
*/
78

89
#include "objects.h"
10+
#include <strsafe.h>
911

1012
#include <wine/debug.h>
1113
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
@@ -209,7 +211,7 @@ AddUrlToFavorites(
209211
// Get title
210212
WCHAR szTitle[MAX_PATH];
211213
if (pszTitleW)
212-
lstrcpynW(szTitle, pszTitleW, _countof(szTitle));
214+
StringCchCopyW(szTitle, _countof(szTitle), pszTitleW);
213215
else
214216
ILGetDisplayNameEx(NULL, pidl, szTitle, ILGDN_NORMAL);
215217

@@ -219,7 +221,7 @@ AddUrlToFavorites(
219221
// Build shortcut pathname
220222
WCHAR szPath[MAX_PATH];
221223
if (!SHGetSpecialFolderPathW(hwnd, szPath, CSIDL_FAVORITES, TRUE))
222-
SHGetSpecialFolderPathW(hwnd, szPath, CSIDL_COMMON_FAVORITES, TRUE);
224+
return E_FAIL;
223225
PathAppendW(szPath, szTitle);
224226
PathAddExtensionW(szPath, L".lnk");
225227

0 commit comments

Comments
 (0)