summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-25 19:15:54 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-26 03:22:27 +0100
commitad4d3a960206e409a6bf3891e49147fc3ce822f7 (patch)
tree388484ce38684d38605bfa2d0691fb53157a04cf /shell
parentd2b181f23f0ba1483066a8fc88d825b4f6b9db29 (diff)
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: I2bfc2f2fa8a405ed36d6bb0c52f961028dd2fe6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163911 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/spsupp/spsuppServ.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/source/win32/spsupp/spsuppServ.cxx b/shell/source/win32/spsupp/spsuppServ.cxx
index abd5ec6070d2..f2afd288e5bb 100644
--- a/shell/source/win32/spsupp/spsuppServ.cxx
+++ b/shell/source/win32/spsupp/spsuppServ.cxx
@@ -40,8 +40,8 @@ ITypeLib* GetTypeLib()
typedef std::unique_ptr<ITypeLib, void(*)(IUnknown* p)> ITypeLibGuard;
static ITypeLibGuard s_aITypeLibGuard = [] {
ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) p->Release(); });
- wchar_t szFile[MAX_PATH];
- if (GetModuleFileNameW(GetHModule(), szFile, MAX_PATH) == 0)
+ wchar_t szFile[32767];
+ if (GetModuleFileNameW(GetHModule(), szFile, std::size(szFile)) == 0)
return aITypeLibGuard;
ITypeLib* pTypeLib;
if (FAILED(LoadTypeLib(szFile, &pTypeLib)))
@@ -55,8 +55,8 @@ ITypeLib* GetTypeLib()
const wchar_t* GetHelperExe()
{
static wchar_t* s_sPath = []() -> wchar_t* {
- static wchar_t sPath[MAX_PATH];
- if (GetModuleFileNameW(GetHModule(), sPath, MAX_PATH) == 0)
+ static wchar_t sPath[32767];
+ if (GetModuleFileNameW(GetHModule(), sPath, std::size(sPath)) == 0)
return nullptr;
wchar_t* pSlashPos = wcsrchr(sPath, L'\\');
if (pSlashPos == nullptr)
@@ -120,8 +120,8 @@ STDAPI DllRegisterServer(void)
if (!pTypeLib)
return ResultFromScode(SELFREG_E_TYPELIB);
- wchar_t szFile[MAX_PATH];
- if (GetModuleFileNameW(GetHModule(), szFile, MAX_PATH) == 0)
+ wchar_t szFile[32767];
+ if (GetModuleFileNameW(GetHModule(), szFile, std::size(szFile)) == 0)
return HRESULT_FROM_WIN32(GetLastError());
HRESULT hr = RegisterTypeLib(pTypeLib, szFile, nullptr);