diff options
author | Lakshmi Priya Sekar <lasekar@microsoft.com> | 2015-09-08 12:01:33 -0700 |
---|---|---|
committer | Lakshmi Priya Sekar <lasekar@microsoft.com> | 2015-09-08 14:31:43 -0700 |
commit | 260f64716ae3bc8fb9ae4708cbb8d4a0a6c48a91 (patch) | |
tree | eaf3d7a932739a8da89e64f0c9ac322e8c671dba /src | |
parent | 2d2d0a5b512e2832565c448d9b4c6d6c1897f150 (diff) | |
download | coreclr-260f64716ae3bc8fb9ae4708cbb8d4a0a6c48a91.tar.gz coreclr-260f64716ae3bc8fb9ae4708cbb8d4a0a6c48a91.tar.bz2 coreclr-260f64716ae3bc8fb9ae4708cbb8d4a0a6c48a91.zip |
Replace MAX_PATH with new defines, rest of coreclr.
Diffstat (limited to 'src')
49 files changed, 270 insertions, 270 deletions
diff --git a/src/ToolBox/SOS/Strike/DisasmARM64.cpp b/src/ToolBox/SOS/Strike/DisasmARM64.cpp index 4bfae58ee1..c597d4f520 100644 --- a/src/ToolBox/SOS/Strike/DisasmARM64.cpp +++ b/src/ToolBox/SOS/Strike/DisasmARM64.cpp @@ -156,7 +156,7 @@ void ARM64Machine::Unassembly ( char line[1024]; ULONG lineNum; ULONG curLine = -1; - char fileName[MAX_PATH+1]; + char fileName[MAX_PATH_FNAME+1]; char *ptr; INT_PTR accumulatedConstant = 0; BOOL loBitsSet = FALSE; @@ -202,7 +202,7 @@ void ARM64Machine::Unassembly ( // // Print out line numbers if needed // - if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(PC), &lineNum, fileName, MAX_PATH+1))) + if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(PC), &lineNum, fileName, MAX_PATH_FNAME+1))) { if (lineNum != curLine) { diff --git a/src/ToolBox/SOS/Strike/datatarget.cpp b/src/ToolBox/SOS/Strike/datatarget.cpp index 4c8ad370e1..82c1f8686d 100644 --- a/src/ToolBox/SOS/Strike/datatarget.cpp +++ b/src/ToolBox/SOS/Strike/datatarget.cpp @@ -89,8 +89,8 @@ DataTarget::GetImageBase( { return E_UNEXPECTED; } - CHAR lpstr[MAX_PATH]; - int name_length = WideCharToMultiByte(CP_ACP, 0, name, -1, lpstr, MAX_PATH, NULL, NULL); + CHAR lpstr[MAX_LONGPATH]; + int name_length = WideCharToMultiByte(CP_ACP, 0, name, -1, lpstr, MAX_LONGPATH, NULL, NULL); if (name_length == 0) { return E_FAIL; diff --git a/src/ToolBox/SOS/Strike/disasm.cpp b/src/ToolBox/SOS/Strike/disasm.cpp index 4adbd2cd75..5d13fbc529 100644 --- a/src/ToolBox/SOS/Strike/disasm.cpp +++ b/src/ToolBox/SOS/Strike/disasm.cpp @@ -101,7 +101,7 @@ GenOpenMapping( // file operations. Convert to ANSI and see if // that helps. - CHAR FilePathA [ MAX_PATH + 10 ]; + CHAR FilePathA [ MAX_LONGPATH + 10 ]; if (WideCharToMultiByte (CP_ACP, 0, @@ -207,7 +207,7 @@ char* PrintOneLine (__in_z char *begin, __in_z char *limit) void UnassemblyUnmanaged(DWORD_PTR IP, BOOL bSuppressLines) { - char filename[MAX_PATH+1]; + char filename[MAX_PATH_FNAME+1]; char line[256]; int lcount = 10; @@ -221,7 +221,7 @@ void UnassemblyUnmanaged(DWORD_PTR IP, BOOL bSuppressLines) ReloadSymbolWithLineInfo(); fLineAvailable = SUCCEEDED (g_ExtSymbols->GetLineByOffset (TO_CDADDR(IP), &linenum, filename, - MAX_PATH+1, + MAX_PATH_FNAME+1, NULL, &Displacement)); } @@ -378,7 +378,7 @@ void UnassemblyUnmanaged(DWORD_PTR IP, BOOL bSuppressLines) } } - char filename1[MAX_PATH+1]; + char filename1[MAX_PATH_FNAME+1]; for (lastLine = beginLine; lastLine < endLine; lastLine ++) { if (IsInterrupt()) return; @@ -410,7 +410,7 @@ void UnassemblyUnmanaged(DWORD_PTR IP, BOOL bSuppressLines) if (vIP > vNextLineIP || vNextLineIP - vIP > 40) { if (FAILED (g_ExtSymbols->GetLineByOffset (vIP, &linenum, filename1, - MAX_PATH+1, + MAX_PATH_FNAME+1, NULL, &Displacement))) { if (lastLine != endOfFunc) { @@ -847,7 +847,7 @@ BOOL PrintCallInfo (DWORD_PTR vEBP, DWORD_PTR IP, BOOL bSymbolOnly) { char Symbol[1024]; - char filename[MAX_PATH+1]; + char filename[MAX_PATH_FNAME+1]; ULONG64 Displacement; BOOL bOutput = FALSE; @@ -927,7 +927,7 @@ BOOL PrintCallInfo (DWORD_PTR vEBP, DWORD_PTR IP, { ULONG line; hr = g_ExtSymbols->GetLineByOffset (TO_CDADDR(IP), &line, filename, - MAX_PATH+1, NULL, NULL); + MAX_PATH_FNAME+1, NULL, NULL); if (SUCCEEDED (hr)) ExtOut (" [%s:%d]", filename, line); } diff --git a/src/ToolBox/SOS/Strike/disasmARM.cpp b/src/ToolBox/SOS/Strike/disasmARM.cpp index 4b37acaf0b..6a604ae5ec 100644 --- a/src/ToolBox/SOS/Strike/disasmARM.cpp +++ b/src/ToolBox/SOS/Strike/disasmARM.cpp @@ -359,7 +359,7 @@ void ARMMachine::Unassembly ( bool fLastWasMovW = false; INT_PTR lowbits = 0; ULONG curLine = -1; - char filename[MAX_PATH+1]; + char filename[MAX_PATH_FNAME+1]; ULONG linenum; while (PC < PCEnd) @@ -370,7 +370,7 @@ void ARMMachine::Unassembly ( // Print out line numbers if needed if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(PC), - &linenum, filename, MAX_PATH+1))) + &linenum, filename, MAX_PATH_FNAME+1))) { if (linenum != curLine) { diff --git a/src/ToolBox/SOS/Strike/disasmX86.cpp b/src/ToolBox/SOS/Strike/disasmX86.cpp index d3b2e7681c..f3c5d9e5b4 100644 --- a/src/ToolBox/SOS/Strike/disasmX86.cpp +++ b/src/ToolBox/SOS/Strike/disasmX86.cpp @@ -526,7 +526,7 @@ void char *ptr; ULONG curLine = -1; - char filename[MAX_PATH+1]; + char filename[MAX_PATH_FNAME+1]; ULONG linenum; while (IP < IPEnd) @@ -537,7 +537,7 @@ void // Print out line numbers if needed if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(IP), - &linenum, filename, MAX_PATH+1))) + &linenum, filename, MAX_PATH_FNAME+1))) { if (linenum != curLine) { diff --git a/src/ToolBox/SOS/Strike/dllsext.cpp b/src/ToolBox/SOS/Strike/dllsext.cpp index 4647a4fc6f..710dff5ddf 100644 --- a/src/ToolBox/SOS/Strike/dllsext.cpp +++ b/src/ToolBox/SOS/Strike/dllsext.cpp @@ -50,7 +50,7 @@ typedef struct _PRIVATE_LDR_DATA_TABLE_ENTRY { #ifndef FEATURE_PAL static void DllsNameFromPeb( ULONG_PTR addrContaining, - __out_ecount (MAX_PATH) WCHAR *dllName + __out_ecount (MAX_LONGPATH) WCHAR *dllName ) { ULONG64 ProcessPeb; @@ -194,17 +194,17 @@ static void DllsNameFromPeb( pLdrEntry + Offset_FullDllName); return; } - ZeroMemory( dllName, MAX_PATH * sizeof (WCHAR) ); + ZeroMemory( dllName, MAX_LONGPATH * sizeof (WCHAR) ); if (FAILED(g_ExtData->ReadVirtual((ULONG64)FullDllName.Buffer, dllName, - MAX_PATH < FullDllName.Length ? MAX_PATH : FullDllName.Length, + MAX_LONGPATH < FullDllName.Length ? MAX_LONGPATH : FullDllName.Length, NULL))) { #if 0 ExtOut ( " Unable to read FullDllName.Buffer address at %p\n", (ULONG64)FullDllName.Buffer); #endif - ZeroMemory( dllName, MAX_PATH * sizeof (WCHAR) ); + ZeroMemory( dllName, MAX_LONGPATH * sizeof (WCHAR) ); } // @@ -228,7 +228,7 @@ static void DllsNameFromPeb( break; } - ZeroMemory( dllName, MAX_PATH * sizeof (WCHAR) ); + ZeroMemory( dllName, MAX_LONGPATH * sizeof (WCHAR) ); if (FAILED(g_ExtData->ReadVirtual(pLdrEntry + Offset_OrderLinks, &LdrEntry.InMemoryOrderLinks, sizeof(LdrEntry.InMemoryOrderLinks), @@ -248,7 +248,7 @@ static void DllsNameFromPeb( HRESULT DllsName( ULONG_PTR addrContaining, - __out_ecount (MAX_PATH) WCHAR *dllName + __out_ecount (MAX_LONGPATH) WCHAR *dllName ) { dllName[0] = L'\0'; @@ -259,14 +259,14 @@ DllsName( if (FAILED(hr)) return hr; - CHAR name[MAX_PATH+1]; + CHAR name[MAX_LONGPATH+1]; ULONG length; - hr = g_ExtSymbols->GetModuleNames(Index,base,name,MAX_PATH,&length,NULL,0,NULL,NULL,0,NULL); + hr = g_ExtSymbols->GetModuleNames(Index,base,name,MAX_LONGPATH,&length,NULL,0,NULL,NULL,0,NULL); if (SUCCEEDED(hr)) { - MultiByteToWideChar (CP_ACP,0,name,-1,dllName,MAX_PATH); + MultiByteToWideChar (CP_ACP,0,name,-1,dllName,MAX_LONGPATH); } #ifndef FEATURE_PAL diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp index bb7e027201..8f56cccaf5 100644 --- a/src/ToolBox/SOS/Strike/strike.cpp +++ b/src/ToolBox/SOS/Strike/strike.cpp @@ -305,7 +305,7 @@ DECLARE_API(IP2MD) DumpMDInfo(TO_TADDR(pMD), cdaStart, FALSE /* fStackTraceFormat */); #ifndef FEATURE_PAL - char filename[MAX_PATH+1]; + char filename[MAX_PATH_FNAME+1]; ULONG linenum; // symlines will be non-zero only if SYMOPT_LOAD_LINES was set in the symbol options ULONG symlines = 0; @@ -318,7 +318,7 @@ DECLARE_API(IP2MD) && SUCCEEDED(GetLineByOffset(TO_CDADDR(IP), &linenum, filename, - MAX_PATH+1))) + MAX_PATH_FNAME+1))) { ExtOut("Source file: %s @ %d\n", filename, linenum); } @@ -1171,7 +1171,7 @@ DECLARE_API(DumpClass) sos::MethodTable mt = TO_TADDR(methodTable); ExtOut("Class Name: %S\n", mt.GetName()); - WCHAR fileName[MAX_PATH]; + WCHAR fileName[MAX_LONGPATH]; FileNameForModule(TO_TADDR(mtdata.Module), fileName); ExtOut("mdToken: %p\n", mtdata.cl); ExtOut("File: %S\n", fileName); @@ -1309,7 +1309,7 @@ DECLARE_API(DumpMT) sos::MethodTable mt = (TADDR)dwStartAddr; table.WriteRow("Name:", mt.GetName()); - WCHAR fileName[MAX_PATH]; + WCHAR fileName[MAX_LONGPATH]; FileNameForModule(TO_TADDR(vMethTable.Module), fileName); table.WriteRow("mdToken:", Pointer(vMethTable.cl)); table.WriteRow("File:", fileName[0] ? fileName : W("Unknown Module")); @@ -2230,7 +2230,7 @@ size_t FormatGeneratedException (DWORD_PTR dataPtr, } // Buffer is calculated for sprintf below (" %p %p %S\n"); - WCHAR wszLineBuffer[mdNameLen + 8 + sizeof(size_t)*2 + MAX_PATH + 8]; + WCHAR wszLineBuffer[mdNameLen + 8 + sizeof(size_t)*2 + MAX_LONGPATH + 8]; if (count==0) { @@ -2294,7 +2294,7 @@ size_t FormatGeneratedException (DWORD_PTR dataPtr, // or did not update so (when ste is an explicit frames), do not update wszBuffer if (Status == S_OK) { - char filename[MAX_PATH+1] = ""; + char filename[MAX_LONGPATH+1] = ""; ULONG linenum = 0; if (bLineNumbers && FAILED(GetLineByOffset(TO_CDADDR(ste.ip), @@ -5243,7 +5243,7 @@ DECLARE_API(DumpModule) return Status; } - WCHAR FileName[MAX_PATH]; + WCHAR FileName[MAX_LONGPATH]; FileNameForModule (&module, FileName); ExtOut("Name: %S\n", FileName[0] ? FileName : W("Unknown Module")); @@ -6060,9 +6060,9 @@ DECLARE_API(WatsonBuckets) struct PendingBreakpoint { - WCHAR szModuleName[MAX_PATH]; + WCHAR szModuleName[MAX_LONGPATH]; WCHAR szFunctionName[mdNameLen]; - WCHAR szFilename[MAX_PATH]; + WCHAR szFilename[MAX_LONGPATH]; DWORD lineNumber; TADDR pModule; DWORD ilOffset; @@ -6160,7 +6160,7 @@ public: if (!IsIn(szModule, szName, mod)) { PendingBreakpoint *pNew = new PendingBreakpoint(); - wcscpy_s(pNew->szModuleName, MAX_PATH, szModule); + wcscpy_s(pNew->szModuleName, MAX_LONGPATH, szModule); wcscpy_s(pNew->szFunctionName, mdNameLen, szName); pNew->SetModule(mod); pNew->ilOffset = ilOffset; @@ -6174,7 +6174,7 @@ public: if (!IsIn(methodToken, mod, ilOffset)) { PendingBreakpoint *pNew = new PendingBreakpoint(); - wcscpy_s(pNew->szModuleName, MAX_PATH, szModule); + wcscpy_s(pNew->szModuleName, MAX_LONGPATH, szModule); wcscpy_s(pNew->szFunctionName, mdNameLen, szName); pNew->methodToken = methodToken; pNew->SetModule(mod); @@ -6189,7 +6189,7 @@ public: if (!IsIn(szFilename, lineNumber, mod)) { PendingBreakpoint *pNew = new PendingBreakpoint(); - wcscpy_s(pNew->szFilename, MAX_PATH, szFilename); + wcscpy_s(pNew->szFilename, MAX_LONGPATH, szFilename); pNew->lineNumber = lineNumber; pNew->SetModule(mod); pNew->pNext = m_breakpoints; @@ -6202,7 +6202,7 @@ public: if (!IsIn(methodToken, mod, ilOffset)) { PendingBreakpoint *pNew = new PendingBreakpoint(); - wcscpy_s(pNew->szFilename, MAX_PATH, szFilename); + wcscpy_s(pNew->szFilename, MAX_LONGPATH, szFilename); pNew->lineNumber = lineNumber; pNew->methodToken = methodToken; pNew->SetModule(mod); @@ -6344,9 +6344,9 @@ public: ToRelease<IMetaDataImport> pMDImport = NULL; IfFailRet(module->QueryInterface(IID_IMetaDataImport, (LPVOID *) &pMDImport)); - WCHAR wszNameBuffer[MAX_PATH]; + WCHAR wszNameBuffer[MAX_LONGPATH]; ULONG32 nameLen = 0; - if(FAILED(Status = module->GetFileName(MAX_PATH, &nameLen, wszNameBuffer))) + if(FAILED(Status = module->GetFileName(MAX_LONGPATH, &nameLen, wszNameBuffer))) { ExtOut("SOS error: IXCLRDataModule->GetFileName failed hr=0x%x\n", wszNameBuffer); return Status; @@ -7076,7 +7076,7 @@ DECLARE_API(bpmd) LPWSTR ModuleName = (LPWSTR)alloca(mdNameLen * sizeof(WCHAR)); LPWSTR FunctionName = (LPWSTR)alloca(mdNameLen * sizeof(WCHAR)); - LPWSTR Filename = (LPWSTR)alloca(MAX_PATH * sizeof(WCHAR)); + LPWSTR Filename = (LPWSTR)alloca(MAX_LONGPATH * sizeof(WCHAR)); BOOL bNeedNotificationExceptions=FALSE; @@ -7094,7 +7094,7 @@ DECLARE_API(bpmd) } else { - MultiByteToWideChar(CP_ACP, 0, DllName.data, -1, Filename, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, DllName.data, -1, Filename, MAX_LONGPATH); } // get modules that may need a breakpoint bound @@ -8967,7 +8967,7 @@ DECLARE_API(Token2EE) } DWORD_PTR dwAddr = moduleList[i]; - WCHAR FileName[MAX_PATH]; + WCHAR FileName[MAX_LONGPATH]; FileNameForModule(dwAddr, FileName); // We'd like a short form for this output @@ -9097,7 +9097,7 @@ DECLARE_API(Name2EE) } DWORD_PTR dwAddr = moduleList[i]; - WCHAR FileName[MAX_PATH]; + WCHAR FileName[MAX_LONGPATH]; FileNameForModule (dwAddr, FileName); // We'd like a short form for this output @@ -12585,11 +12585,11 @@ static HRESULT DumpMDInfoBuffer(DWORD_PTR dwStartAddr, DWORD Flags, ULONG64 Esp, if (g_ExtSymbols->GetModuleByOffset(UL64_TO_CDA(addrInModule), 0, &Index, &base) == S_OK) { - CHAR ModuleName[MAX_PATH+1]; + CHAR ModuleName[MAX_LONGPATH+1]; if (g_ExtSymbols->GetModuleNames (Index, base, NULL, 0, NULL, - ModuleName, MAX_PATH, NULL, + ModuleName, MAX_LONGPATH, NULL, NULL, 0, NULL) == S_OK) { MultiByteToWideChar (CP_ACP, @@ -13864,10 +13864,10 @@ void PrintHelp (__in_z LPCSTR pszCmdName) #else #define SOS_DOCUMENT_FILENAME "sosdocs.txt" - char lpFilename[MAX_PATH+12]; // + 12 to make enough room for strcat function. + char lpFilename[MAX_LONGPATH+12]; // + 12 to make enough room for strcat function. DWORD nReturnedSize; - nReturnedSize = GetModuleFileName(g_hInstance, lpFilename, MAX_PATH); - if ( nReturnedSize == 0 || nReturnedSize == MAX_PATH ) { + nReturnedSize = GetModuleFileName(g_hInstance, lpFilename, MAX_LONGPATH); + if ( nReturnedSize == 0 || nReturnedSize == MAX_LONGPATH ) { // We consider both of these cases as failed. ExtOut("Error getting the name for the current module\n"); return; @@ -13905,7 +13905,7 @@ void PrintHelp (__in_z LPCSTR pszCmdName) } // Find our line in the text file - char searchString[MAX_PATH]; + char searchString[MAX_PATH_FNAME]; sprintf_s(searchString, _countof(searchString), "COMMAND: %s.", pszCmdName); LPSTR pStart = strstr(pText, searchString); diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index 70e3688361..4186dcb415 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -204,7 +204,7 @@ HRESULT CreateInstanceCustomImpl( { _ASSERTE(dllName != NULL); HMODULE hDac = NULL; - WCHAR path[MAX_PATH]; + WCHAR path[MAX_LONGPATH]; if (SUCCEEDED(g_sos->GetDacModuleHandle(&hDac)) && GetPathFromModule(hDac, path, _countof(path))) @@ -249,7 +249,7 @@ HRESULT CreateInstanceCustomImpl( continue; } - ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_PATH+1]; + ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_LONGPATH+1]; if (imgPath == NULL) { continue; @@ -265,7 +265,7 @@ HRESULT CreateInstanceCustomImpl( LPCWSTR pathElem = wcstok_s(imgPath, W(";"), &ctx); while (pathElem != NULL) { - WCHAR fullName[MAX_PATH]; + WCHAR fullName[MAX_LONGPATH]; wcscpy_s(fullName, _countof(fullName), pathElem); if (wcscat_s(fullName, W("\\")) == 0 && wcscat_s(fullName, dllName) == 0) { @@ -354,7 +354,7 @@ HRESULT ClrCreateInstance( { // if we have a v4+ runtime that does not have the fix to activate the requested CLSID // try activating with the path - WCHAR clrDir[MAX_PATH]; + WCHAR clrDir[MAX_LONGPATH]; DWORD cchClrDir = _countof(clrDir); IfFailGo( spClr->GetRuntimeDirectory(clrDir, &cchClrDir) ); IfFailGo( wcscat_s(clrDir, dllName) == 0 ? S_OK : E_FAIL ); @@ -2050,7 +2050,7 @@ CLRDATA_ADDRESS GetAppDomain(CLRDATA_ADDRESS objPtr) return appDomain; } -HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_PATH) WCHAR *fileName) +HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_LONGPATH) WCHAR *fileName) { DacpModuleData ModuleData; fileName[0] = L'\0'; @@ -2070,8 +2070,8 @@ HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_PATH) WCHAR * This function is called to find the file name given a Module. * * * \**********************************************************************/ -// fileName should be at least MAX_PATH -HRESULT FileNameForModule (DacpModuleData *pModule, __out_ecount (MAX_PATH) WCHAR *fileName) +// fileName should be at least MAX_LONGPATH +HRESULT FileNameForModule (DacpModuleData *pModule, __out_ecount (MAX_LONGPATH) WCHAR *fileName) { fileName[0] = L'\0'; @@ -2087,7 +2087,7 @@ HRESULT FileNameForModule (DacpModuleData *pModule, __out_ecount (MAX_PATH) WCHA hr = g_sos->GetPEFileBase(dwAddr, &base); if (SUCCEEDED(hr)) { - hr = g_sos->GetPEFileName(dwAddr, MAX_PATH, fileName, NULL); + hr = g_sos->GetPEFileName(dwAddr, MAX_LONGPATH, fileName, NULL); if (SUCCEEDED(hr)) { if (fileName[0] != L'\0') @@ -2133,7 +2133,7 @@ void AssemblyInfo(DacpAssemblyData *pAssembly) DacpModuleData moduleData; if (moduleData.Request(g_sos,ModuleAddr)==S_OK) { - WCHAR fileName[MAX_PATH]; + WCHAR fileName[MAX_LONGPATH]; FileNameForModule (&moduleData, fileName); if (fileName[0]) { @@ -2643,10 +2643,10 @@ BOOL DebuggerModuleNamesMatch (CLRDATA_ADDRESS PEFileAddr, ___in __in_z LPSTR mN ULONG64 base; if (g_ExtSymbols->GetModuleByOffset(pebase, 0, &Index, &base) == S_OK) { - CHAR ModuleName[MAX_PATH+1]; + CHAR ModuleName[MAX_LONGPATH+1]; if (g_ExtSymbols->GetModuleNames(Index, base, NULL, 0, NULL, ModuleName, - MAX_PATH, NULL, NULL, 0, NULL) == S_OK) + MAX_LONGPATH, NULL, NULL, 0, NULL) == S_OK) { if (_stricmp (ModuleName, mName) == 0) { @@ -2712,7 +2712,7 @@ DWORD_PTR *ModuleFromName(__in_opt LPSTR mName, int *numModule) return NULL; } - WCHAR StringData[MAX_PATH]; + WCHAR StringData[MAX_PATH_FNAME]; char fileName[sizeof(StringData)/2]; // Search all domains to find a module @@ -3602,7 +3602,7 @@ BOOL GetSOSVersion(VS_FIXEDFILEINFO *pFileInfo) { _ASSERTE(pFileInfo); - WCHAR wszFullPath[MAX_PATH]; + WCHAR wszFullPath[MAX_LONGPATH]; DWORD cchFullPath = GetModuleFileNameW(g_hInstance, wszFullPath, _countof(wszFullPath)); DWORD dwHandle = 0; @@ -4155,7 +4155,7 @@ HRESULT LoadClrDebugDll(void) { return E_FAIL; } - char dacModulePath[MAX_PATH]; + char dacModulePath[MAX_LONGPATH]; strcpy_s(dacModulePath, _countof(dacModulePath), g_ExtClient->GetCoreClrDirectory()); strcat_s(dacModulePath, _countof(dacModulePath), MAKEDLLNAME_A("mscordaccore")); @@ -4364,9 +4364,9 @@ public: return hr; } - WCHAR dacPath[MAX_PATH]; - DWORD len = GetModuleFileNameW(dacModule, dacPath, MAX_PATH); - if(len == 0 || len == MAX_PATH) + WCHAR dacPath[MAX_LONGPATH]; + DWORD len = GetModuleFileNameW(dacModule, dacPath, MAX_LONGPATH); + if(len == 0 || len == MAX_LONGPATH) { ExtOut("GetModuleFileName(dacModuleHandle) failed. Last error = 0x%x\n", GetLastError()); return E_FAIL; @@ -4404,7 +4404,7 @@ public: return hr; } - ArrayHolder<WCHAR> symbolPath = new WCHAR[pathSize+MAX_PATH+1]; + ArrayHolder<WCHAR> symbolPath = new WCHAR[pathSize+MAX_LONGPATH+1]; @@ -4415,7 +4415,7 @@ public: return hr; } - WCHAR foundPath[MAX_PATH]; + WCHAR foundPath[MAX_LONGPATH]; BOOL rc = SymFindFileInPathW((HANDLE)hProcess, symbolPath, pwszFileName, @@ -4436,7 +4436,7 @@ public: *phModule = callbackData.hModule; return hr; #else - WCHAR modulePath[MAX_PATH]; + WCHAR modulePath[MAX_LONGPATH]; int length = MultiByteToWideChar(CP_ACP, 0, g_ExtClient->GetCoreClrDirectory(), -1, modulePath, _countof(modulePath)); if (0 >= length) { @@ -6172,7 +6172,7 @@ HRESULT SymbolReader::LoadSymbols(IMetaDataImport * pMD, ICorDebugModule * pModu IfFailRet(pModule->GetBaseAddress(&baseAddress)); ULONG32 len = 0; - WCHAR moduleName[MAX_PATH]; + WCHAR moduleName[MAX_LONGPATH]; IfFailRet(pModule->GetName(_countof(moduleName), &len, moduleName)); return LoadSymbols(pMD, baseAddress, moduleName, isInMemory); @@ -6462,7 +6462,7 @@ WString GetFrameFromAddress(TADDR frameAddr, IXCLRDataStackWalk *pStackWalk) WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines) { - ArrayHolder<char> filename = new char[MAX_PATH+1]; + ArrayHolder<char> filename = new char[MAX_LONGPATH+1]; ULONG linenum; WString methodOutput; CLRDATA_ADDRESS mdesc = 0; @@ -6499,11 +6499,11 @@ WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines) if (g_ExtSymbols->GetModuleByOffset(UL64_TO_CDA(addrInModule), 0, &Index, &moduleBase) == S_OK) { - CHAR ModuleName[MAX_PATH+1]; + CHAR ModuleName[MAX_LONGPATH+1]; if (g_ExtSymbols->GetModuleNames (Index, moduleBase, NULL, 0, NULL, - ModuleName, MAX_PATH, NULL, + ModuleName, MAX_LONGPATH, NULL, NULL, 0, NULL) == S_OK) { MultiByteToWideChar (CP_ACP, @@ -6524,7 +6524,7 @@ WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines) } if (!bSuppressLines && - SUCCEEDED(GetLineByOffset(TO_CDADDR(ip), &linenum, filename, MAX_PATH+1))) + SUCCEEDED(GetLineByOffset(TO_CDADDR(ip), &linenum, filename, MAX_LONGPATH+1))) { int len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); ArrayHolder<WCHAR> wfilename = new WCHAR[len]; diff --git a/src/ToolBox/SOS/Strike/util.h b/src/ToolBox/SOS/Strike/util.h index fb84f5ca39..aa455cb18e 100644 --- a/src/ToolBox/SOS/Strike/util.h +++ b/src/ToolBox/SOS/Strike/util.h @@ -1362,8 +1362,8 @@ private: HRESULT GetMethodDefinitionsFromName(DWORD_PTR ModulePtr, IXCLRDataModule* mod, const char* name, IXCLRDataMethodDefinition **ppMethodDefinitions, int numMethods, int *numMethodsNeeded); HRESULT GetMethodDescsFromName(DWORD_PTR ModulePtr, IXCLRDataModule* mod, const char* name, DWORD_PTR **pOut, int *numMethodDescs); -HRESULT FileNameForModule (DacpModuleData *pModule, __out_ecount (MAX_PATH) WCHAR *fileName); -HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_PATH) WCHAR *fileName); +HRESULT FileNameForModule (DacpModuleData *pModule, __out_ecount (MAX_LONGPATH) WCHAR *fileName); +HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_LONGPATH) WCHAR *fileName); void IP2MethodDesc (DWORD_PTR IP, DWORD_PTR &methodDesc, JITTypes &jitType, DWORD_PTR &gcinfoAddr); const char *ElementTypeName (unsigned type); @@ -1413,7 +1413,7 @@ int bitidx(SCALAR bitflag) HRESULT DllsName( ULONG_PTR addrContaining, - __out_ecount (MAX_PATH) WCHAR *dllName + __out_ecount (MAX_LONGPATH) WCHAR *dllName ); inline diff --git a/src/classlibnative/bcltype/system.cpp b/src/classlibnative/bcltype/system.cpp index b19ea23c88..d5772b2ef5 100644 --- a/src/classlibnative/bcltype/system.cpp +++ b/src/classlibnative/bcltype/system.cpp @@ -347,9 +347,9 @@ FCIMPL0(StringObject*, SystemNative::GetRuntimeDirectory) { FCALL_CONTRACT; - wchar_t wszFile[MAX_PATH+1]; + wchar_t wszFile[MAX_LONGPATH+1]; STRINGREF refRetVal = NULL; - DWORD dwFile = MAX_PATH+1; + DWORD dwFile = MAX_LONGPATH+1; HELPER_METHOD_FRAME_BEGIN_RET_1(refRetVal); diff --git a/src/classlibnative/nls/nlstable.cpp b/src/classlibnative/nls/nlstable.cpp index 11845866a1..45fdf67766 100644 --- a/src/classlibnative/nls/nlstable.cpp +++ b/src/classlibnative/nls/nlstable.cpp @@ -103,9 +103,9 @@ HANDLE NLSTable::CreateSharedMemoryMapping(const LPCWSTR pMappingName, const int // If we are on Windows 2000 or later, try to open it in global namespace. The \global namespace is ignored if // Terminal service is not running. - WCHAR globalSectionName[MAX_PATH]; + WCHAR globalSectionName[MAX_LONGPATH]; wcscpy_s(globalSectionName, COUNTOF(globalSectionName), W("Global\\")); - if (wcslen(pMappingName) + wcslen(globalSectionName) >= MAX_PATH) { + if (wcslen(pMappingName) + wcslen(globalSectionName) >= MAX_LONGPATH) { goto ErrorExit; } wcscat_s(globalSectionName, COUNTOF(globalSectionName), pMappingName); @@ -192,9 +192,9 @@ PBYTE NLSTable::OpenOrCreateMemoryMapping(const LPCWSTR pMappingName, const int // to synchornize different threads. // Try to open it in global namespace. The global\ namespace is ignored if terminal service is not running. - WCHAR globalSectionName[MAX_PATH]; + WCHAR globalSectionName[MAX_LONGPATH]; wcscpy_s(globalSectionName, COUNTOF(globalSectionName), W("Global\\")); - if (wcslen(pMappingName) + wcslen(globalSectionName) >= MAX_PATH) + if (wcslen(pMappingName) + wcslen(globalSectionName) >= MAX_LONGPATH) return NULL; wcscat_s(globalSectionName, COUNTOF(globalSectionName), pMappingName); diff --git a/src/coreclr/hosts/coreconsole/coreconsole.cpp b/src/coreclr/hosts/coreconsole/coreconsole.cpp index 4c8c5279bc..573598627f 100644 --- a/src/coreclr/hosts/coreconsole/coreconsole.cpp +++ b/src/coreclr/hosts/coreconsole/coreconsole.cpp @@ -61,10 +61,10 @@ public: class HostEnvironment { // The path to this module - wchar_t m_hostPath[MAX_PATH]; + wchar_t m_hostPath[MAX_LONGPATH]; // The path to the directory containing this module - wchar_t m_hostDirectoryPath[MAX_PATH]; + wchar_t m_hostDirectoryPath[MAX_LONGPATH]; // The name of this module, without the path wchar_t *m_hostExeName; @@ -84,7 +84,7 @@ class HostEnvironment // On failure returns nullptr. HMODULE TryLoadCoreCLR(const wchar_t* directoryPath) { - wchar_t coreCLRPath[MAX_PATH]; + wchar_t coreCLRPath[MAX_LONGPATH]; wcscpy_s(coreCLRPath, directoryPath); wcscat_s(coreCLRPath, coreCLRDll); @@ -104,8 +104,8 @@ class HostEnvironment return nullptr; } - wchar_t coreCLRLoadedPath[MAX_PATH]; - ::GetModuleFileNameW(result, coreCLRLoadedPath, MAX_PATH); + wchar_t coreCLRLoadedPath[MAX_LONGPATH]; + ::GetModuleFileNameW(result, coreCLRLoadedPath, MAX_LONGPATH); *m_log << W("Loaded: ") << coreCLRLoadedPath << Logger::endl; @@ -114,13 +114,13 @@ class HostEnvironment public: // The path to the directory that CoreCLR is in - wchar_t m_coreCLRDirectoryPath[MAX_PATH]; + wchar_t m_coreCLRDirectoryPath[MAX_LONGPATH]; HostEnvironment(Logger *logger) : m_log(logger), m_CLRRuntimeHost(nullptr) { // Discover the path to this exe's module. All other files are expected to be in the same directory. - DWORD thisModuleLength = ::GetModuleFileNameW(::GetModuleHandleW(nullptr), m_hostPath, MAX_PATH); + DWORD thisModuleLength = ::GetModuleFileNameW(::GetModuleHandleW(nullptr), m_hostPath, MAX_LONGPATH); // Search for the last backslash in the host path. int lastBackslashIndex; @@ -139,12 +139,12 @@ public: *m_log << W("Host directory: ") << m_hostDirectoryPath << Logger::endl; // Check for %CORE_ROOT% and try to load CoreCLR.dll from it if it is set - wchar_t coreRoot[MAX_PATH]; + wchar_t coreRoot[MAX_LONGPATH]; size_t outSize; m_coreCLRModule = NULL; // Initialize this here since we don't call TryLoadCoreCLR if CORE_ROOT is unset. - if (_wgetenv_s(&outSize, coreRoot, MAX_PATH, W("CORE_ROOT")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreRoot, MAX_LONGPATH, W("CORE_ROOT")) == 0 && outSize > 0) { - wcscat_s(coreRoot, MAX_PATH, W("\\")); + wcscat_s(coreRoot, MAX_LONGPATH, W("\\")); m_coreCLRModule = TryLoadCoreCLR(coreRoot); } else @@ -162,7 +162,7 @@ public: if (m_coreCLRModule) { // Save the directory that CoreCLR was found in - DWORD modulePathLength = ::GetModuleFileNameW(m_coreCLRModule, m_coreCLRDirectoryPath, MAX_PATH); + DWORD modulePathLength = ::GetModuleFileNameW(m_coreCLRModule, m_coreCLRDirectoryPath, MAX_LONGPATH); // Search for the last backslash and terminate it there to keep just the directory path with trailing slash for (lastBackslashIndex = modulePathLength-1; lastBackslashIndex >= 0; lastBackslashIndex--) { @@ -192,11 +192,11 @@ public: for (int iExtension = 0; iExtension < countExtensions; iExtension++) { - wchar_t fileName[MAX_PATH]; - wcscpy_s(fileName, MAX_PATH, W("\\")); // So that we don't match other files that end with the current file name - wcscat_s(fileName, MAX_PATH, fileNameWithoutExtension); - wcscat_s(fileName, MAX_PATH, rgTPAExtensions[iExtension] + 1); - wcscat_s(fileName, MAX_PATH, W(";")); // So that we don't match other files that begin with the current file name + wchar_t fileName[MAX_LONGPATH]; + wcscpy_s(fileName, MAX_LONGPATH, W("\\")); // So that we don't match other files that end with the current file name + wcscat_s(fileName, MAX_LONGPATH, fileNameWithoutExtension); + wcscat_s(fileName, MAX_LONGPATH, rgTPAExtensions[iExtension] + 1); + wcscat_s(fileName, MAX_LONGPATH, W(";")); // So that we don't match other files that begin with the current file name if (wcsstr(m_tpaList.CStr(), fileName)) { @@ -229,15 +229,15 @@ public: void AddFilesFromDirectoryToTPAList(wchar_t* targetPath, wchar_t** rgTPAExtensions, int countExtensions) { *m_log << W("Adding assemblies from ") << targetPath << W(" to the TPA list") << Logger::endl; - wchar_t assemblyPath[MAX_PATH]; + wchar_t assemblyPath[MAX_LONGPATH]; for (int iExtension = 0; iExtension < countExtensions; iExtension++) { - wcscpy_s(assemblyPath, MAX_PATH, targetPath); + wcscpy_s(assemblyPath, MAX_LONGPATH, targetPath); const size_t dirLength = wcslen(targetPath); wchar_t* const fileNameBuffer = assemblyPath + dirLength; - const size_t fileNameBufferSize = MAX_PATH - dirLength; + const size_t fileNameBufferSize = MAX_LONGPATH - dirLength; wcscat_s(assemblyPath, rgTPAExtensions[iExtension]); WIN32_FIND_DATA data; @@ -259,8 +259,8 @@ public: } // Remove extension - wchar_t fileNameWithoutExtension[MAX_PATH]; - wcscpy_s(fileNameWithoutExtension, MAX_PATH, data.cFileName); + wchar_t fileNameWithoutExtension[MAX_LONGPATH]; + wcscpy_s(fileNameWithoutExtension, MAX_LONGPATH, data.cFileName); RemoveExtensionAndNi(fileNameWithoutExtension); @@ -297,11 +297,11 @@ public: }; // Add files from %CORE_LIBRARIES% if specified - wchar_t coreLibraries[MAX_PATH]; + wchar_t coreLibraries[MAX_LONGPATH]; size_t outSize; - if (_wgetenv_s(&outSize, coreLibraries, MAX_PATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreLibraries, MAX_LONGPATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) { - wcscat_s(coreLibraries, MAX_PATH, W("\\")); + wcscat_s(coreLibraries, MAX_LONGPATH, W("\\")); AddFilesFromDirectoryToTPAList(coreLibraries, rgTPAExtensions, _countof(rgTPAExtensions)); } else @@ -368,13 +368,13 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo HostEnvironment hostEnvironment(&log); - wchar_t appPath[MAX_PATH] = W(""); - wchar_t appNiPath[MAX_PATH * 2] = W(""); - wchar_t managedAssemblyFullName[MAX_PATH] = W(""); + wchar_t appPath[MAX_LONGPATH] = W(""); + wchar_t appNiPath[MAX_LONGPATH * 2] = W(""); + wchar_t managedAssemblyFullName[MAX_LONGPATH] = W(""); wchar_t* filePart = NULL; - if (!::GetFullPathName(programPath, MAX_PATH, appPath, &filePart)) { + if (!::GetFullPathName(programPath, MAX_LONGPATH, appPath, &filePart)) { log << W("Failed to get full path: ") << programPath << Logger::endl; log << W("Error code: ") << GetLastError() << Logger::endl; return false; @@ -387,22 +387,22 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo log << W("Loading: ") << managedAssemblyFullName << Logger::endl; wcscpy_s(appNiPath, appPath); - wcscat_s(appNiPath, MAX_PATH * 2, W(";")); - wcscat_s(appNiPath, MAX_PATH * 2, appPath); + wcscat_s(appNiPath, MAX_LONGPATH * 2, W(";")); + wcscat_s(appNiPath, MAX_LONGPATH * 2, appPath); // Construct native search directory paths - wchar_t nativeDllSearchDirs[MAX_PATH * 3]; + wchar_t nativeDllSearchDirs[MAX_LONGPATH * 3]; wcscpy_s(nativeDllSearchDirs, appPath); - wchar_t coreLibraries[MAX_PATH]; + wchar_t coreLibraries[MAX_LONGPATH]; size_t outSize; - if (_wgetenv_s(&outSize, coreLibraries, MAX_PATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreLibraries, MAX_LONGPATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) { - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, W(";")); - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, coreLibraries); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, W(";")); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, coreLibraries); } - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, W(";")); - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, hostEnvironment.m_coreCLRDirectoryPath); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, W(";")); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, hostEnvironment.m_coreCLRDirectoryPath); // Start the CoreCLR diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index 6fc58d5343..2efe7e9efb 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -64,10 +64,10 @@ public: class HostEnvironment { // The path to this module - wchar_t m_hostPath[MAX_PATH]; + wchar_t m_hostPath[MAX_LONGPATH]; // The path to the directory containing this module - wchar_t m_hostDirectoryPath[MAX_PATH]; + wchar_t m_hostDirectoryPath[MAX_LONGPATH]; // The name of this module, without the path wchar_t *m_hostExeName; @@ -87,7 +87,7 @@ class HostEnvironment // On failure returns nullptr. HMODULE TryLoadCoreCLR(const wchar_t* directoryPath) { - wchar_t coreCLRPath[MAX_PATH]; + wchar_t coreCLRPath[MAX_LONGPATH]; wcscpy_s(coreCLRPath, directoryPath); wcscat_s(coreCLRPath, coreCLRDll); @@ -107,8 +107,8 @@ class HostEnvironment return nullptr; } - wchar_t coreCLRLoadedPath[MAX_PATH]; - ::GetModuleFileNameW(result, coreCLRLoadedPath, MAX_PATH); + wchar_t coreCLRLoadedPath[MAX_LONGPATH]; + ::GetModuleFileNameW(result, coreCLRLoadedPath, MAX_LONGPATH); *m_log << W("Loaded: ") << coreCLRLoadedPath << Logger::endl; @@ -117,13 +117,13 @@ class HostEnvironment public: // The path to the directory that CoreCLR is in - wchar_t m_coreCLRDirectoryPath[MAX_PATH]; + wchar_t m_coreCLRDirectoryPath[MAX_LONGPATH]; HostEnvironment(Logger *logger) : m_log(logger), m_CLRRuntimeHost(nullptr) { // Discover the path to this exe's module. All other files are expected to be in the same directory. - DWORD thisModuleLength = ::GetModuleFileNameW(::GetModuleHandleW(nullptr), m_hostPath, MAX_PATH); + DWORD thisModuleLength = ::GetModuleFileNameW(::GetModuleHandleW(nullptr), m_hostPath, MAX_LONGPATH); // Search for the last backslash in the host path. int lastBackslashIndex; @@ -142,12 +142,12 @@ public: *m_log << W("Host directory: ") << m_hostDirectoryPath << Logger::endl; // Check for %CORE_ROOT% and try to load CoreCLR.dll from it if it is set - wchar_t coreRoot[MAX_PATH]; + wchar_t coreRoot[MAX_LONGPATH]; size_t outSize; m_coreCLRModule = NULL; // Initialize this here since we don't call TryLoadCoreCLR if CORE_ROOT is unset. - if (_wgetenv_s(&outSize, coreRoot, MAX_PATH, W("CORE_ROOT")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreRoot, MAX_LONGPATH, W("CORE_ROOT")) == 0 && outSize > 0) { - wcscat_s(coreRoot, MAX_PATH, W("\\")); + wcscat_s(coreRoot, MAX_LONGPATH, W("\\")); m_coreCLRModule = TryLoadCoreCLR(coreRoot); } else @@ -165,8 +165,8 @@ public: if (!m_coreCLRModule) { // Failed to load. Try to load from the well-known location. - wchar_t coreCLRInstallPath[MAX_PATH]; - ::ExpandEnvironmentStringsW(coreCLRInstallDirectory, coreCLRInstallPath, MAX_PATH); + wchar_t coreCLRInstallPath[MAX_LONGPATH]; + ::ExpandEnvironmentStringsW(coreCLRInstallDirectory, coreCLRInstallPath, MAX_LONGPATH); m_coreCLRModule = TryLoadCoreCLR(coreCLRInstallPath); } @@ -174,7 +174,7 @@ public: if (m_coreCLRModule) { // Save the directory that CoreCLR was found in - DWORD modulePathLength = ::GetModuleFileNameW(m_coreCLRModule, m_coreCLRDirectoryPath, MAX_PATH); + DWORD modulePathLength = ::GetModuleFileNameW(m_coreCLRModule, m_coreCLRDirectoryPath, MAX_LONGPATH); // Search for the last backslash and terminate it there to keep just the directory path with trailing slash for (lastBackslashIndex = modulePathLength-1; lastBackslashIndex >= 0; lastBackslashIndex--) { @@ -204,11 +204,11 @@ public: for (int iExtension = 0; iExtension < countExtensions; iExtension++) { - wchar_t fileName[MAX_PATH]; - wcscpy_s(fileName, MAX_PATH, W("\\")); // So that we don't match other files that end with the current file name - wcscat_s(fileName, MAX_PATH, fileNameWithoutExtension); - wcscat_s(fileName, MAX_PATH, rgTPAExtensions[iExtension] + 1); - wcscat_s(fileName, MAX_PATH, W(";")); // So that we don't match other files that begin with the current file name + wchar_t fileName[MAX_LONGPATH]; + wcscpy_s(fileName, MAX_LONGPATH, W("\\")); // So that we don't match other files that end with the current file name + wcscat_s(fileName, MAX_LONGPATH, fileNameWithoutExtension); + wcscat_s(fileName, MAX_LONGPATH, rgTPAExtensions[iExtension] + 1); + wcscat_s(fileName, MAX_LONGPATH, W(";")); // So that we don't match other files that begin with the current file name if (wcsstr(m_tpaList.CStr(), fileName)) { @@ -241,15 +241,15 @@ public: void AddFilesFromDirectoryToTPAList(wchar_t* targetPath, wchar_t** rgTPAExtensions, int countExtensions) { *m_log << W("Adding assemblies from ") << targetPath << W(" to the TPA list") << Logger::endl; - wchar_t assemblyPath[MAX_PATH]; + wchar_t assemblyPath[MAX_LONGPATH]; for (int iExtension = 0; iExtension < countExtensions; iExtension++) { - wcscpy_s(assemblyPath, MAX_PATH, targetPath); + wcscpy_s(assemblyPath, MAX_LONGPATH, targetPath); const size_t dirLength = wcslen(targetPath); wchar_t* const fileNameBuffer = assemblyPath + dirLength; - const size_t fileNameBufferSize = MAX_PATH - dirLength; + const size_t fileNameBufferSize = MAX_LONGPATH - dirLength; wcscat_s(assemblyPath, rgTPAExtensions[iExtension]); WIN32_FIND_DATA data; @@ -271,8 +271,8 @@ public: } // Remove extension - wchar_t fileNameWithoutExtension[MAX_PATH]; - wcscpy_s(fileNameWithoutExtension, MAX_PATH, data.cFileName); + wchar_t fileNameWithoutExtension[MAX_PATH_FNAME]; + wcscpy_s(fileNameWithoutExtension, MAX_PATH_FNAME, data.cFileName); RemoveExtensionAndNi(fileNameWithoutExtension); @@ -311,11 +311,11 @@ public: }; // Add files from %CORE_LIBRARIES% if specified - wchar_t coreLibraries[MAX_PATH]; + wchar_t coreLibraries[MAX_LONGPATH]; size_t outSize; - if (_wgetenv_s(&outSize, coreLibraries, MAX_PATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreLibraries, MAX_LONGPATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) { - wcscat_s(coreLibraries, MAX_PATH, W("\\")); + wcscat_s(coreLibraries, MAX_LONGPATH, W("\\")); AddFilesFromDirectoryToTPAList(coreLibraries, rgTPAExtensions, _countof(rgTPAExtensions)); } else @@ -395,14 +395,14 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo return false; } - wchar_t appPath[MAX_PATH] = W(""); - wchar_t appNiPath[MAX_PATH * 2] = W(""); - wchar_t managedAssemblyFullName[MAX_PATH] = W(""); - wchar_t appLocalWinmetadata[MAX_PATH] = W(""); + wchar_t appPath[MAX_LONGPATH] = W(""); + wchar_t appNiPath[MAX_LONGPATH * 2] = W(""); + wchar_t managedAssemblyFullName[MAX_LONGPATH] = W(""); + wchar_t appLocalWinmetadata[MAX_LONGPATH] = W(""); wchar_t* filePart = NULL; - if (!::GetFullPathName(exeName, MAX_PATH, appPath, &filePart)) { + if (!::GetFullPathName(exeName, MAX_LONGPATH, appPath, &filePart)) { log << W("Failed to get full path: ") << exeName << Logger::endl; log << W("Error code: ") << GetLastError() << Logger::endl; return false; @@ -425,22 +425,22 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo } wcscpy_s(appNiPath, appPath); wcscat_s(appNiPath, W("NI")); - wcscat_s(appNiPath, MAX_PATH * 2, W(";")); - wcscat_s(appNiPath, MAX_PATH * 2, appPath); + wcscat_s(appNiPath, MAX_LONGPATH * 2, W(";")); + wcscat_s(appNiPath, MAX_LONGPATH * 2, appPath); // Construct native search directory paths - wchar_t nativeDllSearchDirs[MAX_PATH * 3]; + wchar_t nativeDllSearchDirs[MAX_LONGPATH * 3]; wcscpy_s(nativeDllSearchDirs, appPath); - wchar_t coreLibraries[MAX_PATH]; + wchar_t coreLibraries[MAX_LONGPATH]; size_t outSize; - if (_wgetenv_s(&outSize, coreLibraries, MAX_PATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) + if (_wgetenv_s(&outSize, coreLibraries, MAX_LONGPATH, W("CORE_LIBRARIES")) == 0 && outSize > 0) { - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, W(";")); - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, coreLibraries); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, W(";")); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, coreLibraries); } - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, W(";")); - wcscat_s(nativeDllSearchDirs, MAX_PATH * 3, hostEnvironment.m_coreCLRDirectoryPath); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, W(";")); + wcscat_s(nativeDllSearchDirs, MAX_LONGPATH * 3, hostEnvironment.m_coreCLRDirectoryPath); // Start the CoreCLR diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp index 2c8c8323eb..ff3a8172ad 100644 --- a/src/debug/daccess/daccess.cpp +++ b/src/debug/daccess/daccess.cpp @@ -6631,7 +6631,7 @@ ClrDataAccess::GetMetaDataFromHost(PEFile* peFile, { DWORD imageTimestamp, imageSize, dataSize; void* buffer = NULL; - WCHAR uniPath[MAX_PATH] = {0}; + WCHAR uniPath[MAX_LONGPATH] = {0}; bool isAlt = false; bool isNGEN = false; DAC_INSTANCE* inst = NULL; @@ -6735,7 +6735,7 @@ ClrDataAccess::GetMetaDataFromHost(PEFile* peFile, #if defined(FEATURE_CORESYSTEM) const WCHAR* ilExtension[] = {W("dll"), W("winmd")}; - WCHAR ngenImageName[MAX_PATH] = {0}; + WCHAR ngenImageName[MAX_LONGPATH] = {0}; if (wcscpy_s(ngenImageName, NumItems(ngenImageName), uniPath) != 0) { goto ErrExit; diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp index 619eb06f2d..2d29c9c3a5 100644 --- a/src/debug/daccess/dacdbiimpl.cpp +++ b/src/debug/daccess/dacdbiimpl.cpp @@ -1247,8 +1247,8 @@ bool DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEFile vmPEFile, if (pPEFile == NULL) return false; - WCHAR wszFilePath[MAX_PATH] = {0}; - DWORD cchFilePath = MAX_PATH; + WCHAR wszFilePath[MAX_LONGPATH] = {0}; + DWORD cchFilePath = MAX_LONGPATH; bool ret = ClrDataAccess::GetMetaDataFileInfoFromPEFile(pPEFile, dwTimeStamp, dwSize, @@ -1284,8 +1284,8 @@ bool DacDbiInterfaceImpl::GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile, return false; } - WCHAR wszFilePath[MAX_PATH] = {0}; - DWORD cchFilePath = MAX_PATH; + WCHAR wszFilePath[MAX_LONGPATH] = {0}; + DWORD cchFilePath = MAX_LONGPATH; bool ret = ClrDataAccess::GetILImageInfoFromNgenPEFile(pPEFile, dwTimeStamp, dwSize, diff --git a/src/debug/daccess/request.cpp b/src/debug/daccess/request.cpp index 0e787ca135..af5848288a 100644 --- a/src/debug/daccess/request.cpp +++ b/src/debug/daccess/request.cpp @@ -1269,7 +1269,7 @@ ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, Module* pModule = pMD->GetModule(); if (pModule) { - WCHAR path[MAX_PATH]; + WCHAR path[MAX_LONGPATH]; COUNT_T nChars = 0; if (pModule->GetPath().DacGetUnicode(NumItems(path), path, &nChars) && nChars > 0 && nChars <= NumItems(path)) diff --git a/src/debug/di/process.cpp b/src/debug/di/process.cpp index 41613d8213..484905b62b 100644 --- a/src/debug/di/process.cpp +++ b/src/debug/di/process.cpp @@ -437,7 +437,7 @@ IMDInternalImport * CordbProcess::LookupMetaDataFromDebuggerForSingleFile( { INTERNAL_DAC_CALLBACK(this); - ULONG32 cchLocalImagePath = MAX_PATH; + ULONG32 cchLocalImagePath = MAX_LONGPATH; ULONG32 cchLocalImagePathRequired; NewArrayHolder<WCHAR> pwszLocalFilePath = NULL; IMDInternalImport * pMDII = NULL; @@ -7592,7 +7592,7 @@ void CordbProcess::VerifyControlBlock() } #ifdef _DEBUG - char buf[MAX_PATH]; + char buf[MAX_LONGPATH]; DWORD len = GetEnvironmentVariableA("CORDBG_NotCompatibleTest", buf, sizeof(buf)); _ASSERTE(len < sizeof(buf)); diff --git a/src/debug/di/publish.cpp b/src/debug/di/publish.cpp index db432c94cd..1e16ad510d 100644 --- a/src/debug/di/publish.cpp +++ b/src/debug/di/publish.cpp @@ -494,9 +494,9 @@ CorpubProcess::CorpubProcess(DWORD dwProcessId, // MSDN is very confused about whether the lenght is in bytes (MSDN 2002) or chars (MSDN 2004). // We err on the safe side by having buffer that's twice as large, and ignoring // the units on the return value. - WCHAR szName[MAX_PATH * sizeof(WCHAR)]; + WCHAR szName[MAX_LONGPATH * sizeof(WCHAR)]; - DWORD lenInCharsOrBytes = MAX_PATH*sizeof(WCHAR); + DWORD lenInCharsOrBytes = MAX_LONGPATH*sizeof(WCHAR); // Pass NULL module handle to get "Main Module", which will give us the process name. DWORD ret = (*fpGetModuleFileNameEx) (hProcess, NULL, szName, lenInCharsOrBytes); diff --git a/src/debug/di/shimprocess.cpp b/src/debug/di/shimprocess.cpp index 6e0350b8eb..373f90389c 100644 --- a/src/debug/di/shimprocess.cpp +++ b/src/debug/di/shimprocess.cpp @@ -1829,10 +1829,10 @@ HMODULE ShimProcess::GetDacModule() #ifdef FEATURE_PAL // For now on Unix we'll just search for DAC in the default location. // Debugger can always control it by setting LD_LIBRARY_PATH env var. - WCHAR wszAccessDllPath[MAX_PATH] = MAKEDLLNAME_W(W("mscordaccore")); + WCHAR wszAccessDllPath[MAX_LONGPATH] = MAKEDLLNAME_W(W("mscordaccore")); #else - WCHAR wszAccessDllPath[MAX_PATH]; + WCHAR wszAccessDllPath[MAX_LONGPATH]; // // Load the access DLL from the same directory as the the current CLR Debugging Services DLL. // diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index 4e470b566d..cb757fa0bb 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -6708,7 +6708,7 @@ DebuggerLaunchSetting Debugger::GetDbgJITDebugLaunchSetting() DebuggerLaunchSetting setting = DLS_ASK_USER; - DWORD cchDbgFormat = MAX_PATH; + DWORD cchDbgFormat = MAX_LONGPATH; INDEBUG(DWORD cchOldDbgFormat = cchDbgFormat); #if defined(DACCESS_COMPILE) diff --git a/src/debug/ildbsymlib/symread.cpp b/src/debug/ildbsymlib/symread.cpp index ce94892008..ceaea1c01f 100644 --- a/src/debug/ildbsymlib/symread.cpp +++ b/src/debug/ildbsymlib/symread.cpp @@ -521,7 +521,7 @@ HRESULT SymReader::VerifyPEDebugInfo(const WCHAR* szFileName) // Replace the extension with ildb if (_wsplitpath_s( fullpath, drive, COUNTOF(drive), dir, COUNTOF(dir), fname, COUNTOF(fname), NULL, 0 )) IfFailGo(HrFromWin32(ERROR_BAD_FORMAT)); - if (_wmakepath_s(m_szStoredSymbolName, MAX_PATH, drive, dir, fname, W("ildb") )) + if (_wmakepath_s(m_szStoredSymbolName, MAX_LONGPATH, drive, dir, fname, W("ildb") )) IfFailGo(HrFromWin32(ERROR_BAD_FORMAT)); // It looks valid, make sure to set the return code diff --git a/src/debug/inc/dbgipcevents.h b/src/debug/inc/dbgipcevents.h index d902884f1c..b110a23977 100644 --- a/src/debug/inc/dbgipcevents.h +++ b/src/debug/inc/dbgipcevents.h @@ -2292,7 +2292,7 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { CONNID connectionId; - EmbeddedIPCString<MAX_PATH> wzConnectionName; + EmbeddedIPCString<MAX_LONGPATH> wzConnectionName; } CreateConnection; struct MSLAYOUT diff --git a/src/debug/shim/debugshim.cpp b/src/debug/shim/debugshim.cpp index 7a9def449d..2d4e63cad5 100644 --- a/src/debug/shim/debugshim.cpp +++ b/src/debug/shim/debugshim.cpp @@ -84,10 +84,10 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( HMODULE hDac = NULL; DWORD dbiTimestamp; DWORD dbiSizeOfImage; - WCHAR dbiName[MAX_PATH]; + WCHAR dbiName[MAX_PATH_FNAME]; DWORD dacTimestamp; DWORD dacSizeOfImage; - WCHAR dacName[MAX_PATH]; + WCHAR dacName[MAX_PATH_FNAME]; CLR_DEBUGGING_VERSION version; BOOL versionSupportedByCaller = FALSE; @@ -126,11 +126,11 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( &dbiTimestamp, &dbiSizeOfImage, dbiName, - MAX_PATH, + MAX_PATH_FNAME, &dacTimestamp, &dacSizeOfImage, dacName, - MAX_PATH); + MAX_PATH_FNAME); } // If we need to fetch either the process info or the flags info then we need to find diff --git a/src/dlls/dbgshim/dbgshim.cpp b/src/dlls/dbgshim/dbgshim.cpp index c4930dafd5..42a2d253f9 100644 --- a/src/dlls/dbgshim/dbgshim.cpp +++ b/src/dlls/dbgshim/dbgshim.cpp @@ -370,15 +370,15 @@ bool IsCoreClrWithGoodHeader(HANDLE hProcess, HMODULE hModule) { HRESULT hr = S_OK; - WCHAR modulePath[MAX_PATH]; + WCHAR modulePath[MAX_LONGPATH]; modulePath[0] = W('\0'); - if(0 == GetModuleFileNameEx(hProcess, hModule, modulePath, MAX_PATH)) + if(0 == GetModuleFileNameEx(hProcess, hModule, modulePath, MAX_LONGPATH)) { return false; } else { - modulePath[MAX_PATH-1] = 0; // on older OS'es this doesn't get null terminated automatically on truncation + modulePath[MAX_LONGPATH-1] = 0; // on older OS'es this doesn't get null terminated automatically on truncation } if (IsCoreClr(modulePath)) @@ -467,7 +467,7 @@ HRESULT EnumerateCLRs(DWORD debuggeePID, size_t cbEventArrayData = sizeof(HANDLE) * count; // event array data size_t cbStringArrayData = sizeof(LPWSTR) * count; // string array data - size_t cbStringData = sizeof(WCHAR) * count * MAX_PATH; // strings data + size_t cbStringData = sizeof(WCHAR) * count * MAX_LONGPATH; // strings data size_t cbBuffer = cbEventArrayData + cbStringArrayData + cbStringData; BYTE* pOutBuffer = new (nothrow) BYTE[cbBuffer]; @@ -497,8 +497,8 @@ HRESULT EnumerateCLRs(DWORD debuggeePID, if (IsCoreClrWithGoodHeader(hProcess, modules[i])) { // fill in path - pStringArray[idx] = &pStringData[idx * MAX_PATH]; - GetModuleFileNameEx(hProcess, modules[i], pStringArray[idx], MAX_PATH); + pStringArray[idx] = &pStringData[idx * MAX_LONGPATH]; + GetModuleFileNameEx(hProcess, modules[i], pStringArray[idx], MAX_LONGPATH); #ifndef FEATURE_PAL // fill in event handle -- if GetContinueStartupEvent fails, it will still return @@ -618,14 +618,14 @@ BYTE* GetRemoteModuleBaseAddress(DWORD dwPID, LPCWSTR szFullModulePath) DWORD countModules = min(cbNeeded, sizeof(modules)) / sizeof(HMODULE); for(DWORD i = 0; i < countModules; i++) { - WCHAR modulePath[MAX_PATH]; - if(0 == GetModuleFileNameEx(hProcess, modules[i], modulePath, MAX_PATH)) + WCHAR modulePath[MAX_LONGPATH]; + if(0 == GetModuleFileNameEx(hProcess, modules[i], modulePath, MAX_LONGPATH)) { continue; } else { - modulePath[MAX_PATH-1] = 0; // on older OS'es this doesn't get null terminated automatically + modulePath[MAX_LONGPATH-1] = 0; // on older OS'es this doesn't get null terminated automatically if (_wcsicmp(modulePath, szFullModulePath) == 0) { return (BYTE*) modules[i]; @@ -814,8 +814,8 @@ void GetDbiFilenameNextToRuntime(DWORD pidDebuggee, HMODULE hmodTargetCLR, SStri // Step 1: (pid, hmodule) --> full path // HandleHolder hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pidDebuggee); - WCHAR modulePath[MAX_PATH]; - if(0 == GetModuleFileNameEx(hProcess, hmodTargetCLR, modulePath, MAX_PATH)) + WCHAR modulePath[MAX_LONGPATH]; + if(0 == GetModuleFileNameEx(hProcess, hmodTargetCLR, modulePath, MAX_LONGPATH)) { ThrowHR(E_FAIL); } diff --git a/src/dlls/mscoree/mscoree.cpp b/src/dlls/mscoree/mscoree.cpp index fbddf9c8a2..0be663e9dc 100644 --- a/src/dlls/mscoree/mscoree.cpp +++ b/src/dlls/mscoree/mscoree.cpp @@ -792,8 +792,8 @@ BOOL PAL_GetPALDirectory(__out_ecount(cchBuffer) LPWSTR pbuffer, HRESULT hr = S_OK; - WCHAR pPath[MAX_PATH]; - DWORD dwPath = MAX_PATH; + WCHAR pPath[MAX_LONGPATH]; + DWORD dwPath = MAX_LONGPATH; #ifndef CROSSGEN_COMPILE _ASSERTE(g_pMSCorEE != NULL); @@ -1163,7 +1163,7 @@ ErrExit: { // no runtime info, probably loaded directly (e.g. from Fusion) // just look next to ourselves. - WCHAR wszPath[MAX_PATH]; + WCHAR wszPath[MAX_LONGPATH]; DWORD dwLength = WszGetModuleFileName(g_hThisInst, wszPath,NumItems(wszPath)); diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index b29afec3e8..3c073c5b59 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -9409,7 +9409,7 @@ HRESULT gc_heap::initialize_gc (size_t segment_size, FILE_ATTRIBUTE_NORMAL, NULL); #else // FEATURE_REDHAWK - char logfile_name[MAX_PATH+1]; + char logfile_name[MAX_LONGPATH+1]; if (temp_logfile_name != 0) { int ret; diff --git a/src/inc/bbsweep.h b/src/inc/bbsweep.h index 8b57369cc7..7cebe2000c 100644 --- a/src/inc/bbsweep.h +++ b/src/inc/bbsweep.h @@ -337,7 +337,7 @@ cleanup: void GetObjectNamePrefix(DWORD processID, BOOL fromRuntime, __inout_z WCHAR* objectNamePrefix) { // default prefix - swprintf_s(objectNamePrefix, MAX_PATH, W("Global")); + swprintf_s(objectNamePrefix, MAX_LONGPATH, W("Global")); #ifndef FEATURE_PAL // // This method can be called: diff --git a/src/inc/cor.h b/src/inc/cor.h index 7ef264d80c..63232466c6 100644 --- a/src/inc/cor.h +++ b/src/inc/cor.h @@ -144,7 +144,7 @@ typedef UNALIGNED void const *UVCP_CONSTANT; // Constant for connection id and task id #define INVALID_CONNECTION_ID 0x0 #define INVALID_TASK_ID 0x0 -#define MAX_CONNECTION_NAME MAX_PATH +#define MAX_CONNECTION_NAME MAX_LONGPATH //***************************************************************************** //***************************************************************************** diff --git a/src/inc/dlwrap.h b/src/inc/dlwrap.h index c5d2b83816..9129bcf2bf 100644 --- a/src/inc/dlwrap.h +++ b/src/inc/dlwrap.h @@ -47,7 +47,7 @@ CreateUrlCacheEntryW_NoThrow( IN LPCWSTR lpszUrlName, IN DWORD dwExpectedFileSize, IN LPCWSTR lpszFileExtension, - __out_ecount(MAX_PATH+1) LPWSTR lpszFileName, + __out_ecount(MAX_LONGPATH+1) LPWSTR lpszFileName, IN DWORD dwReserved ); #endif @@ -162,7 +162,7 @@ CopyBindInfo_NoThrow( IN LPCWSTR lpszUrlName, IN DWORD dwExpectedFileSize, IN LPCWSTR lpszFileExtension, - __out_ecount(MAX_PATH+1) LPWSTR lpszFileName, + __out_ecount(MAX_LONGPATH+1) LPWSTR lpszFileName, IN DWORD dwReserved ) { diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index 364b4e17dd..7d380e24de 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -1162,7 +1162,7 @@ void SplitPathInterior( __out_opt LPCWSTR *pwszFileName, __out_opt size_t *pcchFileName, __out_opt LPCWSTR *pwszExt, __out_opt size_t *pcchExt); -void MakePath(__out_ecount (MAX_PATH) register WCHAR *path, +void MakePath(__out_ecount (MAX_LONGPATH) register WCHAR *path, __in LPCWSTR drive, __in LPCWSTR dir, __in LPCWSTR fname, diff --git a/src/inc/zapper.h b/src/inc/zapper.h index e77fd2744b..4eabbf497a 100644 --- a/src/inc/zapper.h +++ b/src/inc/zapper.h @@ -103,7 +103,7 @@ class Zapper CORINFO_ASSEMBLY_HANDLE m_hAssembly; IMDInternalImport *m_pAssemblyImport; - WCHAR m_outputPath[MAX_PATH]; // Temp folder for creating the output file + WCHAR m_outputPath[MAX_LONGPATH]; // Temp folder for creating the output file IMetaDataAssemblyEmit *m_pAssemblyEmit; IMetaDataAssemblyEmit *CreateAssemblyEmitter(); diff --git a/src/ipcman/ipcheader.h b/src/ipcman/ipcheader.h index 98e940699e..20b1e96470 100644 --- a/src/ipcman/ipcheader.h +++ b/src/ipcman/ipcheader.h @@ -509,7 +509,7 @@ struct LegacyPrivateIPCControlBlock // Client blocks struct PerfCounterIPCControlBlock m_perf; // no longer used but kept for compat struct AppDomainEnumerationIPCBlock m_appdomain; - WCHAR m_instancePath[MAX_PATH]; + WCHAR m_instancePath[MAX_LONGPATH]; }; typedef DPTR(LegacyPrivateIPCControlBlock) PTR_LegacyPrivateIPCControlBlock; diff --git a/src/md/compiler/mdvalidator.cpp b/src/md/compiler/mdvalidator.cpp index da559614a4..fd3e47229c 100644 --- a/src/md/compiler/mdvalidator.cpp +++ b/src/md/compiler/mdvalidator.cpp @@ -5404,10 +5404,10 @@ HRESULT RegMeta::ValidateFile(RID rid) else { ULONG L = (ULONG)strlen(szName); - if(L >= MAX_PATH) + if(L >= MAX_PATH_FNAME) { // Name too long - REPORT_ERROR2(VLDTR_E_TD_NAMETOOLONG, L, (ULONG)(MAX_PATH-1)); + REPORT_ERROR2(VLDTR_E_TD_NAMETOOLONG, L, (ULONG)(MAX_PATH_FNAME-1)); SetVldtrCode(&hrSave, VLDTR_S_ERR); } // Check for duplicates based on Name. diff --git a/src/md/compiler/regmeta_vm.cpp b/src/md/compiler/regmeta_vm.cpp index 3a59e94d39..3ea0271ae1 100644 --- a/src/md/compiler/regmeta_vm.cpp +++ b/src/md/compiler/regmeta_vm.cpp @@ -141,7 +141,7 @@ HRESULT RegMeta::StartupEE() { HRESULT hr = S_OK; - DWORD dwBuffer[1 + (MAX_PATH+1) * sizeof(WCHAR) / sizeof(DWORD) + 1]; + DWORD dwBuffer[1 + (MAX_LONGPATH+1) * sizeof(WCHAR) / sizeof(DWORD) + 1]; BSTR bstrDir = NULL; // Create a hosting environment. @@ -159,7 +159,7 @@ HRESULT RegMeta::StartupEE() // Get the current directory (place it in a BSTR). bstrDir = (BSTR)(dwBuffer + 1); - if ((dwBuffer[0] = (WszGetCurrentDirectory(MAX_PATH + 1, bstrDir) * sizeof(WCHAR)))) + if ((dwBuffer[0] = (WszGetCurrentDirectory(MAX_LONGPATH + 1, bstrDir) * sizeof(WCHAR)))) { // QI for the IAppDomainSetup interface. IfFailGo(pParam->pSetup->QueryInterface(IID_IAppDomainSetup, diff --git a/src/palrt/path.cpp b/src/palrt/path.cpp index 3aaae18a27..fa88eb4a84 100644 --- a/src/palrt/path.cpp +++ b/src/palrt/path.cpp @@ -280,7 +280,7 @@ STDAPI_(BOOL) PathCanonicalizeW(LPWSTR lpszDst, LPCWSTR lpszSrc) BOOL fUNC; int cchPC; - RIPMSG(lpszDst && IS_VALID_WRITE_BUFFER(lpszDst, WCHAR, MAX_PATH), "PathCanonicalize: caller passed bad lpszDst"); + RIPMSG(lpszDst && IS_VALID_WRITE_BUFFER(lpszDst, WCHAR, MAX_LONGPATH), "PathCanonicalize: caller passed bad lpszDst"); RIPMSG(lpszSrc && IS_VALID_STRING_PTR(lpszSrc, -1), "PathCanonicalize: caller passed bad lpszSrc"); RIPMSG(lpszDst != lpszSrc, "PathCanonicalize: caller passed the same buffer for lpszDst and lpszSrc"); @@ -466,7 +466,7 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) { // Skip the backslash when copying // Note: We don't support strings longer than 4GB, but that's - // okay because we already barf at MAX_PATH + // okay because we already barf at MAX_LONGPATH lstrcpynW(pszT, lpszFile+1, (int)(ARRAYSIZE(szTemp) - (pszT - szTemp))); } else @@ -541,7 +541,7 @@ STDAPI_(LPWSTR) PathAddBackslashW(LPWSTR lpszPath) // if we find these cases, return NULL. Note: We need to // check those places that call us to handle their GP fault // if they try to use the NULL! - if (ichPath >= (MAX_PATH - 2)) // -2 because ichPath doesn't include NULL, and we're adding a CH_WHACK. + if (ichPath >= (MAX_LONGPATH - 2)) // -2 because ichPath doesn't include NULL, and we're adding a CH_WHACK. { return(NULL); } diff --git a/src/palrt/shstr.h b/src/palrt/shstr.h index 41cc79dffc..0fb7bced28 100644 --- a/src/palrt/shstr.h +++ b/src/palrt/shstr.h @@ -16,7 +16,7 @@ // default shstr to something small, so we don't waste too much stack space // MAX_PATH is used frequently, so we'd like to a factor of that - so that // if we do grow to MAX_PATH size, we don't waste any extra. -#define DEFAULT_SHSTR_LENGTH (MAX_PATH/4) +#define DEFAULT_SHSTR_LENGTH (MAX_PATH_FNAME/4) #ifdef UNICODE diff --git a/src/palrt/urlpars.cpp b/src/palrt/urlpars.cpp index 5f71a88cd8..2570d8da57 100644 --- a/src/palrt/urlpars.cpp +++ b/src/palrt/urlpars.cpp @@ -289,8 +289,8 @@ ParseURLW( #ifdef DEBUG if (hr==S_OK) { - WCHAR rgchDebugProtocol[MAX_PATH]; - WCHAR rgchDebugSuffix[MAX_PATH]; + WCHAR rgchDebugProtocol[MAX_PATH_FNAME]; + WCHAR rgchDebugSuffix[MAX_PATH_FNAME]; // (+ 1) for null terminator. diff --git a/src/strongname/api/strongname.cpp b/src/strongname/api/strongname.cpp index 44ca1735cf..c6e543953b 100644 --- a/src/strongname/api/strongname.cpp +++ b/src/strongname/api/strongname.cpp @@ -2631,8 +2631,8 @@ BOOLEAN RehashModules (SN_LOAD_CTX *pLoadCtx, LPCWSTR wszFilePath) { DWORD cbNewFileHash = 0; DWORD cchDirectory; DWORD cchFullFile; - CHAR szFullFile[MAX_PATH + 1]; - WCHAR wszFullFile[MAX_PATH + 1]; + CHAR szFullFile[MAX_LONGPATH + 1]; + WCHAR wszFullFile[MAX_LONGPATH + 1]; LPCWSTR pszSlash; DWORD cchFile; IMDInternalImport *pMetaDataImport = NULL; @@ -2641,8 +2641,8 @@ BOOLEAN RehashModules (SN_LOAD_CTX *pLoadCtx, LPCWSTR wszFilePath) { // look for linked files). if (((pszSlash = wcsrchr(wszFilePath, W('\\'))) != NULL) || ((pszSlash = wcsrchr(wszFilePath, W('/'))) != NULL)) { cchDirectory = (DWORD) (pszSlash - wszFilePath + 1); - cchDirectory = WszWideCharToMultiByte(CP_UTF8, 0, wszFilePath, cchDirectory, szFullFile, MAX_PATH, NULL, NULL); - if (cchDirectory >= MAX_PATH) { + cchDirectory = WszWideCharToMultiByte(CP_UTF8, 0, wszFilePath, cchDirectory, szFullFile, MAX_LONGPATH, NULL, NULL); + if (cchDirectory >= MAX_LONGPATH) { SNLOG((W("Assembly directory name too long\n"))); hr = ERROR_BUFFER_OVERFLOW; goto Error; @@ -2712,8 +2712,8 @@ BOOLEAN RehashModules (SN_LOAD_CTX *pLoadCtx, LPCWSTR wszFilePath) { cbNewFileHash = cbFileHash; } - cchFullFile = WszMultiByteToWideChar(CP_UTF8, 0, szFullFile, -1, wszFullFile, MAX_PATH); - if (cchFullFile == 0 || cchFullFile >= MAX_PATH) { + cchFullFile = WszMultiByteToWideChar(CP_UTF8, 0, szFullFile, -1, wszFullFile, MAX_LONGPATH); + if (cchFullFile == 0 || cchFullFile >= MAX_LONGPATH) { pMetaDataImport->EnumClose(&hFileEnum); SNLOG((W("Assembly directory name too long\n"))); hr = ERROR_BUFFER_OVERFLOW; @@ -3104,7 +3104,7 @@ HRESULT ReadRegistryConfig() HRESULT ReadVerificationRecords() { HKEYHolder hKey; - WCHAR wszSubKey[MAX_PATH + 1]; + WCHAR wszSubKey[MAX_PATH_FNAME + 1]; DWORD cchSubKey; SN_VER_REC *pVerificationRecords = NULL; HRESULT hr = S_OK; @@ -3117,7 +3117,7 @@ HRESULT ReadVerificationRecords() // just opened. for (DWORD i = 0; ; i++) { // Get the name of the next subkey. - cchSubKey = MAX_PATH + 1; + cchSubKey = MAX_PATH_FNAME + 1; FILETIME sFiletime; if (WszRegEnumKeyEx(hKey, i, wszSubKey, &cchSubKey, NULL, NULL, NULL, &sFiletime) != ERROR_SUCCESS) break; @@ -3270,7 +3270,7 @@ HRESULT ReadReplacementKeys(HKEY hKey, SN_REPLACEMENT_KEY_REC **ppReplacementRec HRESULT ReadRevocationRecordsFromKey(REGSAM samDesired, SN_REVOCATION_REC **ppRevocationRecords) { HKEYHolder hKey; - WCHAR wszSubKey[MAX_PATH + 1]; + WCHAR wszSubKey[MAX_PATH_FNAME + 1]; DWORD cchSubKey; HRESULT hr = S_OK; @@ -3282,7 +3282,7 @@ HRESULT ReadRevocationRecordsFromKey(REGSAM samDesired, SN_REVOCATION_REC **ppRe // just opened. for (DWORD i = 0; ; i++) { // Read the next subkey - cchSubKey = MAX_PATH + 1; // reset size of buffer, as the following call changes it + cchSubKey = MAX_PATH_FNAME + 1; // reset size of buffer, as the following call changes it if (WszRegEnumKeyEx(hKey, i, wszSubKey, &cchSubKey, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) break; @@ -4114,7 +4114,7 @@ HRESULT VerifySignature(__in SN_LOAD_CTX *pLoadCtx, DWORD dwInFlags, PublicKeyBl // Read the public key used to sign the assembly from the assembly metadata. // Also get the assembly name, we might need this if we fail the // verification and need to look up a verification disablement entry. - WCHAR wszSimpleAssemblyName[MAX_PATH + 1]; + WCHAR wszSimpleAssemblyName[MAX_PATH_FNAME + 1]; SString strFullyQualifiedAssemblyName; BOOL bSuccess = FALSE; #if STRONGNAME_IN_VM diff --git a/src/tools/crossgen/crossgen.cpp b/src/tools/crossgen/crossgen.cpp index 6f180a1441..192f6b1bf8 100644 --- a/src/tools/crossgen/crossgen.cpp +++ b/src/tools/crossgen/crossgen.cpp @@ -460,7 +460,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) LPCWSTR pwzAppNiPaths = nullptr; LPCWSTR pwzPlatformAssembliesPaths = nullptr; LPCWSTR pwzPlatformWinmdPaths = nullptr; - WCHAR wzDirectoryToStorePDB[MAX_PATH] = W("\0"); + WCHAR wzDirectoryToStorePDB[MAX_LONGPATH] = W("\0"); bool fCreatePDB = false; bool fGeneratePDBLinesInfo = false; LPWSTR pwzSearchPathForManagedPDB = NULL; @@ -896,7 +896,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) PrintLogoHelper(); } - WCHAR wzTrustedPathRoot[MAX_PATH]; + WCHAR wzTrustedPathRoot[MAX_LONGPATH]; #ifdef FEATURE_CORECLR SString ssTPAList; @@ -917,7 +917,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) if (pwzTrustedPlatformAssemblies != nullptr) { - if (ComputeMscorlibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, MAX_PATH, pwzTrustedPlatformAssemblies)) + if (ComputeMscorlibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, MAX_LONGPATH, pwzTrustedPlatformAssemblies)) { pwzPlatformAssembliesPaths = wzTrustedPathRoot; SetMscorlibPath(pwzPlatformAssembliesPaths); @@ -927,7 +927,7 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) if (pwzPlatformAssembliesPaths == NULL) { - if (!WszGetModuleFileName(NULL, wzTrustedPathRoot, MAX_PATH)) + if (!WszGetModuleFileName(NULL, wzTrustedPathRoot, MAX_LONGPATH)) { ERROR_WIN32(W("Error: GetModuleFileName failed (%d)\n"), GetLastError()); exit(CLR_INIT_ERROR); diff --git a/src/tools/util/consoleargs.cpp b/src/tools/util/consoleargs.cpp index fd89726541..1473206721 100644 --- a/src/tools/util/consoleargs.cpp +++ b/src/tools/util/consoleargs.cpp @@ -340,7 +340,7 @@ void ConsoleArgs::CleanUpArgs() bool ConsoleArgs::GetFullFileName(LPCWSTR szSource, __out_ecount(cchFilenameBuffer) LPWSTR filenameBuffer, DWORD cchFilenameBuffer, bool fOutputFilename) { #ifdef PLATFORM_UNIX - WCHAR tempBuffer[MAX_PATH]; + WCHAR tempBuffer[MAX_LONGPATH]; memset(filenameBuffer, 0, cchFilenameBuffer * sizeof(WCHAR)); if (!PathCanonicalizeW(tempBuffer, szSource) || StringCchCopyW(filenameBuffer, cchFilenameBuffer, tempBuffer) != S_OK) @@ -882,7 +882,7 @@ void ConsoleArgs::ProcessResponseArgs() HRESULT hr; b_tree *response_files = NULL; - WCHAR szFilename[MAX_PATH]; + WCHAR szFilename[MAX_LONGPATH]; for (WStrList * listCurArg = m_listArgs; listCurArg != NULL && !m_errorOccured; @@ -901,7 +901,7 @@ void ConsoleArgs::ProcessResponseArgs() } // Check for duplicates - if (!GetFullFileName(&szArg[1], szFilename, MAX_PATH, false)) + if (!GetFullFileName(&szArg[1], szFilename, MAX_LONGPATH, false)) continue; diff --git a/src/utilcode/dlwrap.cpp b/src/utilcode/dlwrap.cpp index 6cd8f44932..f649e5267b 100644 --- a/src/utilcode/dlwrap.cpp +++ b/src/utilcode/dlwrap.cpp @@ -91,7 +91,7 @@ CreateUrlCacheEntryW_NoThrow( IN LPCWSTR lpszUrlName, IN DWORD dwExpectedFileSize, IN LPCWSTR lpszFileExtension, - __out_ecount(MAX_PATH+1) LPWSTR lpszFileName, + __out_ecount(MAX_LONGPATH+1) LPWSTR lpszFileName, IN DWORD dwReserved ) { diff --git a/src/utilcode/log.cpp b/src/utilcode/log.cpp index f18b7f1b96..df290c4d71 100644 --- a/src/utilcode/log.cpp +++ b/src/utilcode/log.cpp @@ -33,7 +33,7 @@ static DWORD LogFlags = 0; -static char szLogFileName[MAX_PATH+1] = DEFAULT_LOGFILE_NAME; +static char szLogFileName[MAX_LONGPATH+1] = DEFAULT_LOGFILE_NAME; static HANDLE LogFileHandle = INVALID_HANDLE_VALUE; static MUTEX_COOKIE LogFileMutex = 0; static DWORD LogFacilityMask = LF_ALL; @@ -123,7 +123,7 @@ VOID InitLogging() } if (LogFileHandle == INVALID_HANDLE_VALUE) { DWORD written; - char buff[MAX_PATH+60]; + char buff[MAX_LONGPATH+60]; strcpy(buff, "Could not open log file, logging to "); strcat_s(buff, _countof(buff), szLogFileName); // ARULM--Changed WriteConsoleA to WriteFile to be CE compat diff --git a/src/utilcode/makepath.cpp b/src/utilcode/makepath.cpp index 0443b991aa..f58efdc246 100644 --- a/src/utilcode/makepath.cpp +++ b/src/utilcode/makepath.cpp @@ -40,7 +40,7 @@ *******************************************************************************/ void MakePath ( - __out_ecount (MAX_PATH) WCHAR *path, + __out_ecount (MAX_LONGPATH) WCHAR *path, __in LPCWSTR drive, __in LPCWSTR dir, __in LPCWSTR fname, @@ -92,7 +92,7 @@ void MakePath ( *path++ = *p++; count++; - if (count == MAX_PATH) { + if (count == MAX_LONGPATH) { --path; *path = _T('\0'); return; @@ -112,7 +112,7 @@ void MakePath ( *path++ = _T('\\'); count++; - if (count == MAX_PATH) { + if (count == MAX_LONGPATH) { --path; *path = _T('\0'); return; @@ -127,7 +127,7 @@ void MakePath ( *path++ = *p++; count++; - if (count == MAX_PATH) { + if (count == MAX_LONGPATH) { --path; *path = _T('\0'); return; @@ -144,7 +144,7 @@ void MakePath ( *path++ = _T('.'); count++; - if (count == MAX_PATH) { + if (count == MAX_LONGPATH) { --path; *path = _T('\0'); return; @@ -154,7 +154,7 @@ void MakePath ( while ((*path++ = *p++)) { count++; - if (count == MAX_PATH) { + if (count == MAX_LONGPATH) { --path; *path = _T('\0'); return; diff --git a/src/utilcode/stacktrace.cpp b/src/utilcode/stacktrace.cpp index 7cea7ffc92..f2086182f3 100644 --- a/src/utilcode/stacktrace.cpp +++ b/src/utilcode/stacktrace.cpp @@ -617,13 +617,13 @@ DWORD_PTR dwAddr { if (mbi.Type & MEM_IMAGE) { - char achFile[MAX_PATH] = {0}; + char achFile[MAX_LONGPATH] = {0}; DWORD cch; cch = GetModuleFileNameA( (HINSTANCE)mbi.AllocationBase, achFile, - MAX_PATH); + MAX_LONGPATH); // Ignore the return code since we can't do anything with it. _SymLoadModule( diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp index 3bc6f73382..e7d6a620ff 100644 --- a/src/utilcode/util.cpp +++ b/src/utilcode/util.cpp @@ -56,12 +56,12 @@ void InitWinRTStatus() const WCHAR wszComBaseDll[] = W("\\combase.dll"); const SIZE_T cchComBaseDll = _countof(wszComBaseDll); - WCHAR wszComBasePath[MAX_PATH + 1]; + WCHAR wszComBasePath[MAX_LONGPATH + 1]; const SIZE_T cchComBasePath = _countof(wszComBasePath); ZeroMemory(wszComBasePath, cchComBasePath * sizeof(wszComBasePath[0])); - UINT cchSystemDirectory = WszGetSystemDirectory(wszComBasePath, MAX_PATH); + UINT cchSystemDirectory = WszGetSystemDirectory(wszComBasePath, MAX_LONGPATH); // Make sure that we're only probing in the system directory. If we can't find the system directory, or // we find it but combase.dll doesn't fit into it, we'll fall back to a safe default of saying that WinRT @@ -3630,7 +3630,7 @@ namespace Util DWORD cCharsNeeded; cCharsNeeded = GetEnvironmentVariableW(W("LOCALAPPDATA"), NULL, 0); - if ((cCharsNeeded != 0) && (cCharsNeeded < MAX_PATH)) + if ((cCharsNeeded != 0) && (cCharsNeeded < MAX_LONGPATH)) { wszLocalAppData = new WCHAR[cCharsNeeded]; cCharsNeeded = GetEnvironmentVariableW(W("LOCALAPPDATA"), wszLocalAppData, cCharsNeeded); diff --git a/src/utilcode/util_nodependencies.cpp b/src/utilcode/util_nodependencies.cpp index 8246a2074a..27720ae0f8 100644 --- a/src/utilcode/util_nodependencies.cpp +++ b/src/utilcode/util_nodependencies.cpp @@ -384,7 +384,7 @@ BOOL IsCurrentModuleFileNameInAutoExclusionList() return FALSE; } - WCHAR wszAppName[MAX_PATH]; + WCHAR wszAppName[MAX_LONGPATH]; DWORD cchAppName = NumItems(wszAppName); // Get the appname to look up in the exclusion or inclusion list. @@ -419,7 +419,7 @@ void GetDebuggerSettingInfo(SString &ssDebuggerString, BOOL *pfAuto) EX_TRY { - DWORD cchDebuggerString = MAX_PATH; + DWORD cchDebuggerString = MAX_LONGPATH; INDEBUG(DWORD cchOldDebuggerString = cchDebuggerString); WCHAR * buf = ssDebuggerString.OpenUnicodeBuffer(cchDebuggerString); @@ -553,7 +553,7 @@ HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, BOOL fAuto = FALSE; // Get the appname to look up in DebugApplications key. - WCHAR wzAppName[MAX_PATH]; + WCHAR wzAppName[MAX_LONGPATH]; DWORD cchAppName = NumItems(wzAppName); long iValue; @@ -573,9 +573,9 @@ HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, { // Look in AeDebug key for "Auto"; get the size of any value stored there. ret = WszRegQueryValueEx(hKeyHolder, kUnmanagedDebuggerAutoValue, 0, &valueType, 0, &valueSize); - if ((ret == ERROR_SUCCESS) && (valueType == REG_SZ) && (valueSize / sizeof(WCHAR) < MAX_PATH)) + if ((ret == ERROR_SUCCESS) && (valueType == REG_SZ) && (valueSize / sizeof(WCHAR) < MAX_LONGPATH)) { - WCHAR wzAutoKey[MAX_PATH]; + WCHAR wzAutoKey[MAX_LONGPATH]; valueSize = NumItems(wzAutoKey) * sizeof(WCHAR); WszRegQueryValueEx(hKeyHolder, kUnmanagedDebuggerAutoValue, NULL, NULL, reinterpret_cast< LPBYTE >(wzAutoKey), &valueSize); diff --git a/src/utilcode/utilmessagebox.cpp b/src/utilcode/utilmessagebox.cpp index 83e2831c20..f28d2d48f3 100644 --- a/src/utilcode/utilmessagebox.cpp +++ b/src/utilcode/utilmessagebox.cpp @@ -38,8 +38,8 @@ UINT GetCLRMBRTLStyle() WRAPPER_NO_CONTRACT; UINT mbStyle = 0; - WCHAR buff[MAX_PATH]; - if(SUCCEEDED(UtilLoadStringRC(IDS_RTL, buff, MAX_PATH, true))) { + WCHAR buff[MAX_LONGPATH]; + if(SUCCEEDED(UtilLoadStringRC(IDS_RTL, buff, MAX_LONGPATH, true))) { if(wcscmp(buff, W("RTL_True")) == 0) { mbStyle = 0x00080000 |0x00100000; // MB_RIGHT || MB_RTLREADING } @@ -152,8 +152,8 @@ int MessageBoxImpl( ACTCTX ctx = { sizeof(ACTCTX) }; ctx.dwFlags = 0; StackSString manifestPath; // Point this at %windir%\WindowsShell.manifest, for comctl32 version 6. - UINT numChars = WszGetWindowsDirectory(manifestPath.OpenUnicodeBuffer(MAX_PATH), MAX_PATH); - if (numChars == 0 || numChars >= MAX_PATH) + UINT numChars = WszGetWindowsDirectory(manifestPath.OpenUnicodeBuffer(MAX_PATH_FNAME), MAX_PATH_FNAME); + if (numChars == 0 || numChars >= MAX_PATH_FNAME) { _ASSERTE(0); // How did this fail? } @@ -359,7 +359,7 @@ int UtilMessageBoxNonLocalizedVA( formattedMessage.VPrintf(lpText, args); // Try to get filename of Module and add it to title - if (showFileNameInTitle && WszGetModuleFileName(NULL, fileName.OpenUnicodeBuffer(MAX_PATH), MAX_PATH)) + if (showFileNameInTitle && WszGetModuleFileName(NULL, fileName.OpenUnicodeBuffer(MAX_LONGPATH), MAX_LONGPATH)) { LPCWSTR wszName = NULL; size_t cchName = 0; diff --git a/src/zap/zapimage.h b/src/zap/zapimage.h index ea222a4f80..ac982f2ba3 100644 --- a/src/zap/zapimage.h +++ b/src/zap/zapimage.h @@ -1318,7 +1318,7 @@ struct RSDS { DWORD magic; GUID signature; DWORD age; - char path[MAX_PATH]; + char path[MAX_LONGPATH]; }; #define SEEK(pos) \ diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp index b0a5aca8bd..0a7aa8ad31 100644 --- a/src/zap/zapper.cpp +++ b/src/zap/zapper.cpp @@ -731,15 +731,15 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi HRESULT hr = E_FAIL; #ifdef FEATURE_MERGE_JIT_AND_ENGINE - WCHAR CoreClrFolder[MAX_PATH + 1]; + WCHAR CoreClrFolder[MAX_LONGPATH + 1]; extern HINSTANCE g_hThisInst; - if (WszGetModuleFileName(g_hThisInst, CoreClrFolder, MAX_PATH)) + if (WszGetModuleFileName(g_hThisInst, CoreClrFolder, MAX_LONGPATH)) { WCHAR *filePtr = wcsrchr(CoreClrFolder, W('\\')); if (filePtr) { filePtr[1] = W('\0'); - wcscat_s(CoreClrFolder, MAX_PATH, pwzJitName); + wcscat_s(CoreClrFolder, MAX_LONGPATH, pwzJitName); *phJit = ::WszLoadLibrary(CoreClrFolder); if (*phJit == NULL) { @@ -1462,8 +1462,8 @@ void Zapper::PrintAssemblyVersionInfo(IAssemblyName *pName, SString &s) // WCHAR szGuid[64]; - WCHAR path[MAX_PATH]; - DWORD cPath = MAX_PATH; + WCHAR path[MAX_LONGPATH]; + DWORD cPath = MAX_LONGPATH; IfFailThrow(QueryNativeAssemblyInfo(pName, path, &cPath)); @@ -2213,8 +2213,8 @@ void Zapper::CreatePdbInCurrentDomain(BSTR pAssemblyPathOrName, BSTR pNativeImag // Now is a good time to make sure pNativeImagePath is the same native image // fusion loaded { - WCHAR wzZapImagePath[MAX_PATH] = {0}; - DWORD dwZapImagePathLength = MAX_PATH; + WCHAR wzZapImagePath[MAX_LONGPATH] = {0}; + DWORD dwZapImagePathLength = MAX_LONGPATH; hr = E_FAIL; if (m_pEECompileInfo->CheckAssemblyZap(hAssembly, wzZapImagePath, &dwZapImagePathLength)) @@ -2386,8 +2386,8 @@ void Zapper::ComputeDependenciesInCurrentDomain(LPCWSTR pAssemblyString, CORCOMP // Check if we have a native image already, and if so get its GUID // - WCHAR zapManifestPath[MAX_PATH]; - DWORD cZapManifestPath = MAX_PATH; + WCHAR zapManifestPath[MAX_LONGPATH]; + DWORD cZapManifestPath = MAX_LONGPATH; if (pNativeImageSig && m_pEECompileInfo->CheckAssemblyZap(hAssembly, zapManifestPath, &cZapManifestPath)) { @@ -2821,8 +2821,8 @@ Exit: #ifdef FEATURE_FUSION BOOL Zapper::CheckAssemblyUpToDate(CORINFO_ASSEMBLY_HANDLE hAssembly, CORCOMPILE_NGEN_SIGNATURE * pNativeImageSig) { - WCHAR zapManifestPath[MAX_PATH]; - DWORD cZapManifestPath = MAX_PATH; + WCHAR zapManifestPath[MAX_LONGPATH]; + DWORD cZapManifestPath = MAX_LONGPATH; if (!m_pEECompileInfo->CheckAssemblyZap( hAssembly, @@ -2861,7 +2861,7 @@ BOOL Zapper::TryToInstallFromRepository(CORINFO_ASSEMBLY_HANDLE hAssembly, CORCO // First see if the NI is available in a folder named "NGen" under the CLR location. // This folder is used by CBS to store build lab generated NIs. Moving files out of // this folder might confuse CBS, so we hard link NIs from this folder into the NIC. - WCHAR wszNGenPath[MAX_PATH]; + WCHAR wszNGenPath[MAX_LONGPATH]; DWORD dwNGenPathLen = COUNTOF(wszNGenPath); IfFailThrow(GetInternalSystemDirectory(wszNGenPath, &dwNGenPathLen)); @@ -3099,8 +3099,8 @@ void Zapper::InstallFromRepository(LPCWSTR lpszNativeImage, PrintFusionCacheEntry(LogLevel_Info, pName); } - WCHAR zapManifestPath[MAX_PATH]; - DWORD cPath = MAX_PATH; + WCHAR zapManifestPath[MAX_LONGPATH]; + DWORD cPath = MAX_LONGPATH; IfFailThrow(pAssemblyLocation->GetPath(zapManifestPath, &cPath)); if (pNativeImageSig) @@ -3209,7 +3209,7 @@ void Zapper::GetOutputFolder() will move the files to the NIC preserving the security attributes. Now other users cannot use the ngen images, which is bad. */ - WCHAR tempFolder[MAX_PATH]; + WCHAR tempFolder[MAX_LONGPATH]; DWORD tempFolderLen = NumItems(tempFolder); IfFailThrow(GetCachePath(ASM_CACHE_ZAP, tempFolder, &tempFolderLen)); |