From 276f8ef88083e4ed9ab21989b2eb5de6222dbf5d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 25 Feb 2024 19:22:43 +0600 Subject: Use SHGetKnownFolderPath to avoid MAX_PATH limitation Change-Id: Icba230fedc9e6071d3817454f55d4533727e3aa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163916 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- extensions/source/update/check/updatecheckconfig.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 708aba65811d..52deb59528fb 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -183,13 +183,13 @@ OUString UpdateCheckConfig::getAllUsersDirectory() OUString aRet; #ifdef _WIN32 - WCHAR szPath[MAX_PATH]; - - if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true)) + PWSTR szPath = nullptr; + if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_PublicDocuments, KF_FLAG_CREATE, nullptr, &szPath))) { aRet = o3tl::toU(szPath); osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); } + CoTaskMemFree(szPath); #else osl::FileBase::getTempDirURL(aRet); #endif -- cgit