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>
This commit is contained in:
parent
d2b181f23f
commit
ad4d3a9602
1 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue