vcl/win/dtrans/FmtFilter.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 66590cba87d7a2b14207ed2cec2531f1d1addf40 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Feb 25 19:05:05 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Feb 26 03:18:21 2024 +0100 Replace an instance of MAX_PATH with 32767 ... which is the approximate maximum of Windows API, as documented in https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation Change-Id: I625ef246aa890f389d5f3a6b0b31456e8ae8b2b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163904 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/vcl/win/dtrans/FmtFilter.cxx b/vcl/win/dtrans/FmtFilter.cxx index 27d051f7e8a7..59e9d0beda51 100644 --- a/vcl/win/dtrans/FmtFilter.cxx +++ b/vcl/win/dtrans/FmtFilter.cxx @@ -322,9 +322,9 @@ static std::wstring getShellLinkTarget(const std::wstring& aLnkFile) if (FAILED(hr)) return target; - wchar_t pathW[MAX_PATH]; + wchar_t pathW[32767]; WIN32_FIND_DATAW wfd; - hr = pIShellLink->GetPath(pathW, MAX_PATH, &wfd, SLGP_RAWPATH); + hr = pIShellLink->GetPath(pathW, std::size(pathW), &wfd, SLGP_RAWPATH); if (FAILED(hr)) return target; @@ -381,8 +381,8 @@ css::uno::Sequence<sal_Int8> CF_HDROPToFileList(HGLOBAL hGlobal) for (UINT i = 0; i < nFiles; i++) { - wchar_t buff[MAX_PATH]; - /*UINT size =*/ DragQueryFileW(static_cast<HDROP>(hGlobal), i, buff, MAX_PATH); + wchar_t buff[32767]; + /*UINT size =*/ DragQueryFileW(static_cast<HDROP>(hGlobal), i, buff, std::size(buff)); std::wstring filename = buff; if (isShellLink(filename)) filename = getShellLinkTarget(filename);