}
#endif // !FEATURE_CORESYSTEM
- WCHAR objectName[MAX_PATH];
- WCHAR objectNamePrefix[MAX_PATH];
+ WCHAR objectName[MAX_LONGPATH];
+ WCHAR objectNamePrefix[MAX_LONGPATH];
GetObjectNamePrefix(processID, fromRuntime, objectNamePrefix);
// if there is a non-empty name prefix, append a '\'
if (objectNamePrefix[0] != '\0')
wcscat_s(objectNamePrefix, ARRAYSIZE(objectNamePrefix), W("\\"));
- swprintf_s(objectName, MAX_PATH, W("%sBBSweep_hSweepMutex"), objectNamePrefix);
+ swprintf_s(objectName, MAX_LONGPATH, W("%sBBSweep_hSweepMutex"), objectNamePrefix);
hSweepMutex = ::WszCreateMutex(pSecurityAttributes, false, objectName);
- swprintf_s(objectName, MAX_PATH, W("%sBBSweep_hProfDataWriterMutex"), objectNamePrefix);
+ swprintf_s(objectName, MAX_LONGPATH, W("%sBBSweep_hProfDataWriterMutex"), objectNamePrefix);
hProfDataWriterMutex = ::WszCreateMutex(pSecurityAttributes, false, objectName);
- swprintf_s(objectName, MAX_PATH, W("%sBBSweep_hSweepEvent"), objectNamePrefix);
+ swprintf_s(objectName, MAX_LONGPATH, W("%sBBSweep_hSweepEvent"), objectNamePrefix);
hSweepEvent = ::WszCreateEvent(pSecurityAttributes, true, false, objectName);
// Note that hTerminateEvent is not a named event. That is because it is not
// shared amongst the CLR processes (each process terminates at a different time)
hTerminationEvent = ::WszCreateEvent(pSecurityAttributes, true, false, NULL);
- swprintf_s(objectName, MAX_PATH, W("%sBBSweep_hProfWriterSemaphore"), objectNamePrefix);
+ swprintf_s(objectName, MAX_LONGPATH, W("%sBBSweep_hProfWriterSemaphore"), objectNamePrefix);
hProfWriterSemaphore = ::WszCreateSemaphore(pSecurityAttributes, MAX_COUNT, MAX_COUNT, objectName);
#ifndef FEATURE_CORESYSTEM // @CORESYSTEMTODO
// construct the object name prefix using AppContainerNamedObjectPath
if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken) && IsAppContainerProcess(hToken))
{
- WCHAR appxNamedObjPath[MAX_PATH] = { 0 };
+ WCHAR appxNamedObjPath[MAX_LONGPATH] = { 0 };
ULONG appxNamedObjPathBufLen = 0;
if (fromRuntime)
DWORD sessionId = 0;
ProcessIdToSessionId(processID, &sessionId);
pfnGetAppContainerNamedObjectPath(hToken, NULL, sizeof (appxNamedObjPath) / sizeof (WCHAR), appxNamedObjPath, &appxNamedObjPathBufLen);
- swprintf_s(objectNamePrefix, MAX_PATH, W("Global\\Session\\%d\\%s"), sessionId, appxNamedObjPath);
+ swprintf_s(objectNamePrefix, MAX_LONGPATH, W("Global\\Session\\%d\\%s"), sessionId, appxNamedObjPath);
}
}
}
STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
{
#ifdef DEBUG
- RIPMSG(lpszDest && IS_VALID_WRITE_BUFFER(lpszDest, TCHAR, MAX_PATH), "PathCombine: caller passed bad lpszDest");
+ RIPMSG(lpszDest && IS_VALID_WRITE_BUFFER(lpszDest, TCHAR, MAX_LONGPATH), "PathCombine: caller passed bad lpszDest");
RIPMSG(!lpszDir || IS_VALID_STRING_PTR(lpszDir, -1), "PathCombine: caller passed bad lpszDir");
RIPMSG(!lpszFile || IS_VALID_STRING_PTR(lpszFile, -1), "PathCombine: caller passed bad lpszFile");
RIPMSG(lpszDir || lpszFile, "PathCombine: caller neglected to pass lpszDir or lpszFile");
if (lpszDest)
{
- TCHAR szTemp[MAX_PATH];
+ TCHAR szTemp[MAX_LONGPATH];
LPWSTR pszT;
*szTemp = W('\0');
}
// Get the appname to look up in the exclusion or inclusion list.
- WCHAR appPath[MAX_PATH + 2];
+ WCHAR appPath[MAX_LONGPATH + 2];
DWORD ret = WszGetModuleFileName(NULL, appPath, NumItems(appPath));
RegKeyHolder userKey;
RegKeyHolder machineKey;
- WCHAR pVersion[MAX_PATH];
- DWORD dwVersion = MAX_PATH;
+ WCHAR pVersion[MAX_PATH_FNAME];
+ DWORD dwVersion = MAX_PATH_FNAME;
HRESULT hr = S_OK;
hr = FusionBind::GetVersion(pVersion, &dwVersion);
if(SUCCEEDED(hr)) {
DWORD cchSubKeySize = 0;
if (WszRegQueryInfoKey(hKeyAptca, NULL, NULL, NULL, NULL, &cchSubKeySize, NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
{
- cchSubKeySize = MAX_PATH;
+ cchSubKeySize = MAX_PATH_FNAME;
}
++cchSubKeySize;
{
STANDARD_VM_CONTRACT;
- WCHAR path[MAX_PATH];
+ WCHAR path[MAX_LONGPATH];
HRESULT hr = WszSHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, ARRAYSIZE(path), path);
if (hr != S_OK)
{
for (DWORD i = 0; ; i++)
{
- WCHAR name[MAX_PATH + 1];
+ WCHAR name[MAX_PATH_FNAME + 1];
DWORD cchName = ARRAYSIZE(name);
status = RegEnumKeyExW(hKey, i, name, &cchName, NULL, NULL, NULL, NULL);
const void *pvData=0; // Pointer to the resource.
ULONG cbData; // Size of the resource data.
ULONG cbWritten;
- WCHAR szFile[MAX_PATH+1]; // File name for resource file.
- WCHAR szPath[MAX_PATH+1]; // Path name for resource file.
+ WCHAR szFile[MAX_PATH_FNAME+1]; // File name for resource file.
+ WCHAR szPath[MAX_LONGPATH+1]; // Path name for resource file.
HandleHolder hFile;
res.SetInfo(pwzFilename,
// messages including the path/file name</TODO>
// Persist to a file.
- if (!WszGetTempPath(MAX_PATH, szPath))
+ if (!WszGetTempPath(MAX_LONGPATH, szPath))
COMPlusThrowWin32();
if (!WszGetTempFileName(szPath, W("RES"), 0, szFile))
COMPlusThrowWin32();
}
if (ArgvW != NULL && ArgvW[0] != NULL) {
- WCHAR wszModuleName[MAX_PATH];
- WCHAR wszCurDir[MAX_PATH];
- if (!WszGetCurrentDirectory(MAX_PATH, wszCurDir))
+ WCHAR wszModuleName[MAX_LONGPATH];
+ WCHAR wszCurDir[MAX_LONGPATH];
+ if (!WszGetCurrentDirectory(MAX_LONGPATH, wszCurDir))
return FALSE;
#ifdef _PREFAST_
EX_TRY_NOCATCH(LPWSTR, pImageNameInner, pImageNameIn)
{
- WCHAR wzPath[MAX_PATH];
+ WCHAR wzPath[MAX_LONGPATH];
DWORD dwPathLength = 0;
// get the path of executable
- dwPathLength = WszGetFullPathName(pImageNameInner, MAX_PATH, wzPath, NULL);
+ dwPathLength = WszGetFullPathName(pImageNameInner, MAX_LONGPATH, wzPath, NULL);
- if (!dwPathLength || dwPathLength > MAX_PATH)
+ if (!dwPathLength || dwPathLength > MAX_LONGPATH)
{
ThrowWin32( !dwPathLength ? GetLastError() : ERROR_FILENAME_EXCED_RANGE);
}
if (!WszGetModuleFileName(GetModuleInst(), (PWSTR)
g_pIPCManagerInterface->
GetInstancePath(),
- MAX_PATH))
+ MAX_LONGPATH))
{
hr = HRESULT_FROM_GetLastErrorNA();
}
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, DIRECTORY_SEPARATOR_CHAR_W);
if (filePtr)
{
filePtr[1] = W('\0');
- wcscat_s(CoreClrFolder, MAX_PATH, pwzJitName);
+ wcscat_s(CoreClrFolder, MAX_LONGPATH, pwzJitName);
*phJit = CLRLoadLibrary(CoreClrFolder);
if (*phJit != NULL)
{
// back to JIT64. This same file is also used to prevent this app from participating in AutoNgen.
if (AppX::IsAppXProcess())
{
- WCHAR szPathName[MAX_PATH];
- UINT32 cchPathName = MAX_PATH;
+ WCHAR szPathName[MAX_LONGPATH];
+ UINT32 cchPathName = MAX_LONGPATH;
if (AppX::FindFileInCurrentPackage(L"UseLegacyJit.txt", &cchPathName, szPathName, PACKAGE_FILTER_HEAD) == S_OK)
{
fUsingCompatJit = TRUE;
QCALL_CONTRACT;
BEGIN_QCALL;
- WCHAR wszPath[MAX_PATH + 1];
+ WCHAR wszPath[MAX_LONGPATH + 1];
GetRootDirInternal(dwFlags, wszPath, COUNTOF(wszPath));
retRootDir.Set(wszPath);
CONTRACTL {
STANDARD_VM_CHECK;
PRECONDITION(cPath > 1);
- PRECONDITION(cPath <= MAX_PATH + 1);
+ PRECONDITION(cPath <= MAX_LONGPATH + 1);
} CONTRACTL_END;
ULONG len;
//
if (pModule->GetFile()->GetAssembly()->GetILimage()->IsTrustedNativeImage())
{
- WCHAR fileNameWithoutNi[MAX_PATH];
+ WCHAR fileNameWithoutNi[MAX_LONGPATH];
- wcscpy_s(fileNameWithoutNi, MAX_PATH, fileName);
+ wcscpy_s(fileNameWithoutNi, MAX_LONGPATH, fileName);
if (StringEndsWith(fileName, W(".ni.dll")))
{
- wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.dll")), MAX_PATH, W(".dll"));
+ wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.dll")), MAX_LONGPATH, W(".dll"));
}
else if (StringEndsWith(fileName, W(".ni.exe")))
{
- wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.exe")), MAX_PATH, W(".exe"));
+ wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.exe")), MAX_LONGPATH, W(".exe"));
}
else if (StringEndsWith(fileName, W(".ni.winmd")))
{
- wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.winmd")), MAX_PATH, W(".winmd"));
+ wcscpy_s(fileNameWithoutNi + wcslen(fileNameWithoutNi) - wcslen(W(".ni.winmd")), MAX_LONGPATH, W(".winmd"));
}
retString.Set(fileNameWithoutNi);
// interfaces and close the PDB file BEFORE this holder tries to *delete* the PDB
// file. Also, keep these two in this relative order, so that m_deletePDBFileHolder
// is destructed before m_wszPDBFilePath.
- WCHAR m_wszPDBFilePath[MAX_PATH];
+ WCHAR m_wszPDBFilePath[MAX_LONGPATH];
DeleteFileHolder m_deletePDBFileHolder;
//
// ************* NOTE! *************
UINT64 cbStringTableEstimate =
sizeof(DWORD) +
sizeof(CV_DebugSSubsectionHeader_t) +
- m_cDocs * (MAX_PATH + 1);
+ m_cDocs * (MAX_LONGPATH + 1);
if (!FitsIn<ULONG32>(cbStringTableEstimate))
{
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
// The actual strings
for (ULONG32 i=0; i < m_cDocs; i++)
{
- WCHAR wszURL[MAX_PATH];
+ WCHAR wszURL[MAX_LONGPATH];
ULONG32 cchURL;
hr = m_rgpDocs[i]->GetURL(_countof(wszURL), &cchURL, wszURL);
if (FAILED(hr))
GetSvcLogger()->Log(W("Loaded managed PDB"));
// Grab the full path of the managed PDB so we can log it
- WCHAR wszIlPdbPath[MAX_PATH];
+ WCHAR wszIlPdbPath[MAX_LONGPATH];
ULONG32 cchIlPdbPath;
hr = m_pReader->GetSymbolStoreFileName(
_countof(wszIlPdbPath),
// write it into the NGEN PDB.
for (ULONG32 i=0; i < m_cDocs; i++)
{
- WCHAR wszURL[MAX_PATH];
- char szURL[MAX_PATH];
+ WCHAR wszURL[MAX_LONGPATH];
+ char szURL[MAX_LONGPATH];
ULONG32 cchURL;
hr = m_rgpDocs[i]->GetURL(_countof(wszURL), &cchURL, wszURL);
if (FAILED(hr))
BOOL fBeginNewBlock = TRUE;
ULONG32 iSeqPointsPrev = (ULONG32) -1;
DWORD dwNativeOffsetPrev = (DWORD) -1;
- WCHAR wszURLPrev[MAX_PATH];
+ WCHAR wszURLPrev[MAX_LONGPATH];
memset(&wszURLPrev, 0, sizeof(wszURLPrev));
LPBYTE pbEnd = NULL;
// This is the first iteration where we're looking at this iSeqPoints. So
// check whether the document name has changed on us. If it has, that means
// we need to start a new block.
- WCHAR wszURL[MAX_PATH];
+ WCHAR wszURL[MAX_LONGPATH];
ULONG32 cchURL;
hr = m_rgpDocs[iSeqPoints]->GetURL(_countof(wszURL), &cchURL, wszURL);
if (FAILED(hr))
}
// Now get the info we'll need for the next block
- char szURL[MAX_PATH];
+ char szURL[MAX_LONGPATH];
int cbWritten = WideCharToMultiByte(
CP_UTF8,
0, // dwFlags
{
if (NingenEnabled())
{
- WCHAR buf[MAX_PATH + sizeof(CONFIGURATION_EXTENSION)/sizeof(WCHAR) + 1];
+ WCHAR buf[MAX_LONGPATH + sizeof(CONFIGURATION_EXTENSION)/sizeof(WCHAR) + 1];
if (0 != wcscpy_s(buf, sizeof(buf)/sizeof(*buf), path))
{
COMPlusThrowHR(COR_E_PATHTOOLONG);
if(g_fEEStarted)
return HOST_E_INVALIDOPERATION;
- if (pValue == NULL || wcslen(pValue) > MAX_PATH)
+ if (pValue == NULL || wcslen(pValue) > MAX_LONGPATH)
return E_INVALIDARG;
HRESULT hr = S_OK;
if (wszDirectory == nullptr)
return ERROR_NOT_SUPPORTED;
- WCHAR wszFilePath[MAX_PATH + 1];
+ WCHAR wszFilePath[MAX_LONGPATH + 1];
wcscpy_s(
wszFilePath,
_countof(wszFilePath),
if (*(wszFirstFileNameChar - 1) != '\\')
*wszFirstFileNameChar++ = '\\';
- WCHAR wszRemainingNamespace[MAX_PATH +1];
+ WCHAR wszRemainingNamespace[MAX_PATH_FNAME +1];
wcscpy_s(
wszRemainingNamespace,
_countof(wszRemainingNamespace),
// Use the MethodDesc...
ULONG32 sourceLine = 0;
ULONG32 sourceColumn = 0;
- WCHAR wszFileName[MAX_PATH];
+ WCHAR wszFileName[MAX_LONGPATH];
ULONG32 fileNameLength = 0;
{
// Also get the filename from the document...
_ASSERTE (documents [j] != NULL);
- hr = documents [j]->GetURL (MAX_PATH, &fileNameLength, wszFileName);
+ hr = documents [j]->GetURL (MAX_LONGPATH, &fileNameLength, wszFileName);
_ASSERTE ( SUCCEEDED(hr) || (hr == E_OUTOFMEMORY) || (hr == HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY)) );
CONTRACTL_END;
HMODULE hModule = WszGetModuleHandle(NULL);
- WCHAR appPath[MAX_PATH];
+ WCHAR appPath[MAX_LONGPATH];
DWORD cchAppPath = NumItems(appPath);
if (GetCurrentModuleFileName(appPath, &cchAppPath) == S_OK)
CONTRACTL_END;
HMODULE hModule = WszGetModuleHandle(NULL);
- WCHAR appPath[MAX_PATH];
+ WCHAR appPath[MAX_LONGPATH];
DWORD cchAppPath = NumItems(appPath);
WCHAR verBuf[23];
CONTRACTL_END;
WCHAR wszDACName[] = MAIN_DAC_MODULE_NAME_W W(".dll");
- WCHAR wszDACPath[MAX_PATH];
+ WCHAR wszDACPath[MAX_LONGPATH];
DWORD dwSize = 0;
if ((FAILED(::GetCORSystemDirectoryInternal(wszDACPath, NumItems(wszDACPath), &dwSize))) ||
startupInfo.cb = sizeof(STARTUPINFOW);
- WCHAR watsonAppName[MAX_PATH];
- WCHAR watsonCommandLine[MAX_PATH+1];
+ WCHAR watsonAppName[MAX_LONGPATH];
+ WCHAR watsonCommandLine[MAX_LONGPATH+1];
{
#if !defined(FEATURE_CORECLR)
m_eventType = type;
HMODULE hModule = WszGetModuleHandle(NULL);
- WCHAR appPath[MAX_PATH];
+ WCHAR appPath[MAX_LONGPATH];
DWORD ret = WszGetModuleFileName(hModule, appPath, NumItems(appPath));
fBufferFull = FALSE;
_ASSERTE(hModRuntime != NULL);
// Get the path to the runtime
- WCHAR runtimePath[MAX_PATH];
+ WCHAR runtimePath[MAX_LONGPATH];
DWORD ret = WszGetModuleFileName(hModRuntime, runtimePath, NumItems(runtimePath));
if (ret != 0)
{
PCWSTR szDtraceOutput1=W(""),szDtraceOutput2=W("");
UINT8 startupMode = 0;
UINT startupFlags = 0;
- WCHAR dllPath[MAX_PATH+1] = {0};
+ WCHAR dllPath[MAX_LONGPATH+1] = {0};
UINT8 Sku = 0;
_ASSERTE(g_fEEManagedEXEStartup || //CLR started due to a managed exe
g_fEEIJWStartup || //CLR started as a mixed mode Assembly
startupMode = ETW::InfoLog::InfoStructs::Other;
}
- _ASSERTE (NumItems(dllPath) > MAX_PATH);
+ _ASSERTE (NumItems(dllPath) > MAX_LONGPATH);
// if WszGetModuleFileName fails, we return an empty string
if (!WszGetModuleFileName(GetCLRModule(), dllPath, MAX_PATH)) {
dllPath[0] = 0;
return;
// cbDebugData actually can be < sizeof(CV_INFO_PDB70), since the "path" field
- // can be truncated to its actual data length (i.e., fewer than MAX_PATH chars
+ // can be truncated to its actual data length (i.e., fewer than MAX_LONGPATH chars
// may be present in the PE file). In some cases, though, cbDebugData will
- // include all MAX_PATH chars even though path gets null-terminated well before
- // the MAX_PATH limit.
+ // include all MAX_LONGPATH chars even though path gets null-terminated well before
+ // the MAX_LONGPATH limit.
// Gotta have at least one byte of the path
if (cbDebugData < offsetof(CV_INFO_PDB70, path) + sizeof(char))
{
WRAPPER_NO_CONTRACT;
- InlineSString<MAX_PATH> sFormat;
+ InlineSString<MAX_LONGPATH> sFormat;
#ifdef FEATURE_FUSION
const WCHAR *pwzLoadContext = GetContextName(pPEAssembly->GetLoadContext(),
pPEAssembly->IsIntrospectionOnly());
_ASSERTE(pPEAssemblyTypeFrom != NULL);
_ASSERTE(pPEAssemblyTypeTo != NULL);
- InlineSString<MAX_PATH> sAssemblyFromDisplayName;
- InlineSString<MAX_PATH> sAssemblyToDisplayName;
+ InlineSString<MAX_LONGPATH> sAssemblyFromDisplayName;
+ InlineSString<MAX_LONGPATH> sAssemblyToDisplayName;
pPEAssemblyTypeFrom->GetDisplayName(sAssemblyFromDisplayName);
pPEAssemblyTypeTo->GetDisplayName(sAssemblyToDisplayName);
// Found the culprit case. Now format the new exception text.
InlineSString<MAX_CLASSNAME_LENGTH + 1> strCastFromName;
InlineSString<MAX_CLASSNAME_LENGTH + 1> strCastToName;
- InlineSString<MAX_PATH> sAssemblyDetailInfoFrom;
- InlineSString<MAX_PATH> sAssemblyDetailInfoTo;
+ InlineSString<MAX_LONGPATH> sAssemblyDetailInfoFrom;
+ InlineSString<MAX_LONGPATH> sAssemblyDetailInfoTo;
thCastFrom.GetName(strCastFromName);
thCastTo.GetName(strCastToName);
extern HMODULE g_pMSCorEE;
extern BOOL g_bRunningOnNT6OrHigher;
-WCHAR g_szWindowsDir[MAX_PATH+1];
-WCHAR g_FusionDllPath[MAX_PATH+1];
+WCHAR g_szWindowsDir[MAX_LONGPATH+1];
+WCHAR g_FusionDllPath[MAX_LONGPATH+1];
HINSTANCE g_hInst = NULL;
HMODULE g_hMSCorEE = NULL;
DWORD g_dwLogInMemory;
PEKIND g_peKindProcess;
List<CAssemblyDownload *> *g_pDownloadList;
BOOL g_bLogToWininet;
-WCHAR g_wzCustomLogPath[MAX_PATH];
+WCHAR g_wzCustomLogPath[MAX_LONGPATH];
DWORD g_dwConfigForceUnification;
DWORD g_dwFileInUseRetryAttempts;
DWORD g_dwFileInUseMillisecondsBetweenRetries;
IIdentityAuthority *g_pIdentityAuthority;
CIdentityCache *g_pIdentityCache;
-WCHAR g_wzEXEPath[MAX_PATH+1];
+WCHAR g_wzEXEPath[MAX_LONGPATH+1];
#ifdef _DEBUG
BOOL g_bCheckedMSIPresent;
HMODULE g_hModMSI;
-WCHAR g_wzLocalDevOverridePath[MAX_PATH + 1];
-WCHAR g_wzGlobalDevOverridePath[MAX_PATH + 1];
+WCHAR g_wzLocalDevOverridePath[MAX_LONGPATH + 1];
+WCHAR g_wzGlobalDevOverridePath[MAX_LONGPATH + 1];
DWORD g_dwDevOverrideFlags;
HRESULT GetScavengerQuotasFromReg(DWORD *pdwZapQuotaInGAC,
#define _GetConfigDWORD(name, default) GetConfigDWORD(hKey, name, default)
// Get this executable's filename
- fExecutableIsKnown = WszGetModuleFileName(NULL, g_wzEXEPath, MAX_PATH);
+ fExecutableIsKnown = WszGetModuleFileName(NULL, g_wzEXEPath, MAX_LONGPATH);
if(!fExecutableIsKnown) {
hr = StringCbCopy(g_wzEXEPath, sizeof(g_wzEXEPath), W("Unknown"));
if (FAILED(hr)) {
// executable, then read it
pwzFileName = PathFindFileName(g_wzEXEPath);
if(fExecutableIsKnown && pwzFileName) {
- WCHAR wzValue[MAX_PATH + 1];
+ WCHAR wzValue[MAX_LONGPATH + 1];
HKEY hKeyExeName = NULL;
DWORD dwType = REG_SZ;
wzValue[0] = W('\0');
// key name + '\' + filename + null
- if(lstrlenW(REG_KEY_IMAGE_FILE_EXECUTION_OPTIONS) + 1 + lstrlenW(pwzFileName) + 1 > MAX_PATH) {
+ if(lstrlenW(REG_KEY_IMAGE_FILE_EXECUTION_OPTIONS) + 1 + lstrlenW(pwzFileName) + 1 > MAX_PATH_FNAME) {
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
goto Exit;
}
- hr = StringCchPrintf(wzValue, MAX_PATH, W("%ws\\%ws"),
+ hr = StringCchPrintf(wzValue, MAX_PATH_FNAME, W("%ws\\%ws"),
REG_KEY_IMAGE_FILE_EXECUTION_OPTIONS, pwzFileName);
if (FAILED(hr)) {
goto Exit;
}
}
else { // Success
- dwSize = MAX_PATH * sizeof(WCHAR);
+ dwSize = MAX_LONGPATH * sizeof(WCHAR);
wzValue[0] = W('\0');
lResult = WszRegQueryValueEx(hKeyExeName, BINDING_CONFIGURATION, NULL, &dwType, (LPBYTE)wzValue, &dwSize);
// If we didn't get a path from the registry,
// try the ENV variable.
if(!wzBindingConfigPath[0]) {
- dwSize = WszGetEnvironmentVariable(BINDING_CONFIGURATION, wzBindingConfigPath, MAX_PATH);
- if(dwSize > MAX_PATH) {
+ dwSize = WszGetEnvironmentVariable(BINDING_CONFIGURATION, wzBindingConfigPath, MAX_LONGPATH);
+ if(dwSize > MAX_LONGPATH) {
hr = HRESULT_FROM_WIN32(ERROR_BUFFER_OVERFLOW);
goto Exit;
}
}
{
- WCHAR wzBuf[MAX_PATH];
+ WCHAR wzBuf[1];
wzBuf[0] = W('\0');
- dwSize = WszGetEnvironmentVariable(W("USE_LEGACY_IDENTITY_FORMAT"), wzBuf, MAX_PATH);
+ dwSize = WszGetEnvironmentVariable(W("USE_LEGACY_IDENTITY_FORMAT"), wzBuf, 1);
if (dwSize == 1 && !FusionCompareString(wzBuf, W("1"))) {
g_dwUseLegacyIdentityFormat = 1;
}
if (IsLoggingNeeded()) {
g_bLogToWininet = TRUE;
- dwSize = MAX_PATH;
+ dwSize = MAX_LONGPATH;
DWORD dwAttr;
BOOL fExists;
g_wzCustomLogPath[0] = W('\0');
if (g_dwDevOverrideEnable != 0) {
// Check local dev path
- if (!WszGetModuleFileName(NULL, g_wzLocalDevOverridePath, MAX_PATH)) {
+ if (!WszGetModuleFileName(NULL, g_wzLocalDevOverridePath, MAX_LONGPATH)) {
hr = HRESULT_FROM_GetLastError();
goto Exit;
}
- if (lstrlenW(g_wzLocalDevOverridePath) + lstrlenW(DEVOVERRIDE_PATH) <= MAX_PATH) {
- // Only process .devoverride if the total path length <= MAX_PATH
+ if (lstrlenW(g_wzLocalDevOverridePath) + lstrlenW(DEVOVERRIDE_PATH) <= MAX_LONGPATH) {
+ // Only process .devoverride if the total path length <= MAX_LONGPATH
hr = StringCbCat(g_wzLocalDevOverridePath, sizeof(g_wzLocalDevOverridePath), DEVOVERRIDE_PATH);
if (FAILED(hr)) {
// BINDING_CONFIGURATION Env check
if(pwzBindingConfigDevOverridePath && pwzBindingConfigDevOverridePath[0]) {
- WCHAR wzTempPath[MAX_PATH + 1];
+ WCHAR wzTempPath[MAX_LONGPATH + 1];
BOOL fExists = FALSE;
WIN32_FILE_ATTRIBUTE_DATA fileInfo;
}
if(g_dwDevOverrideFlags & DEVOVERRIDE_GLOBAL) {
- PathAddBackslashWrap(g_wzGlobalDevOverridePath, MAX_PATH);
+ PathAddBackslashWrap(g_wzGlobalDevOverridePath, MAX_LONGPATH);
}
}
}
}
}
- wszDirectory = new WCHAR[MAX_PATH + 1];
- wszVersion = new WCHAR[MAX_PATH + 1];
+ wszDirectory = new WCHAR[MAX_LONGPATH + 1];
+ wszVersion = new WCHAR[MAX_PATH_FNAME + 1];
wszVersion[0] = 0; // we don't prefer any version
- DWORD cchBuffer = MAX_PATH;
+ DWORD cchBuffer = MAX_LONGPATH;
// Use GetRequestedRuntimeInfo because MetaHost APIs do not yet support architecture arguments.
// Calls to GetRequestedRuntimeInfo() will goes to a local copy inside clr.dll,
0, // startupFlags
dwRuntimeInfoFlags, // Will bind to post-v2 runtimes if EXE PE runtime version is post-v2
// or EXE has config file binding to post-v2 runtime.
- wszDirectory, MAX_PATH, NULL, // Retrieve bound directory
- wszVersion, MAX_PATH, NULL); // Retrieve bound version
+ wszDirectory, MAX_LONGPATH, NULL, // Retrieve bound directory
+ wszVersion, MAX_PATH_FNAME, NULL); // Retrieve bound version
if (SUCCEEDED(hr)) {
commandLine.Append(wszDirectory);
enum
{
// If required buffer length > MAX_LOCAL_BUFFER_LENGTH, don't optimize by allocating memory on stack
- MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH + 1) * 2
+ MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH_FNAME + 1) * 2
};
ILWSTRBufferMarshaler() :
enum
{
// If required buffer length > MAX_LOCAL_BUFFER_LENGTH, don't optimize by allocating memory on stack
- MAX_LOCAL_BUFFER_LENGTH = MAX_PATH + 1
+ MAX_LOCAL_BUFFER_LENGTH = MAX_PATH_FNAME + 1
};
ILCSTRBufferMarshaler() :
enum
{
// If required buffer length > MAX_LOCAL_BUFFER_LENGTH, don't optimize by allocating memory on stack
- MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH + 1) * 2 + sizeof(DWORD)
+ MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH_FNAME + 1) * 2 + sizeof(DWORD)
};
enum
{
// If required buffer length > MAX_LOCAL_BUFFER_LENGTH, don't optimize by allocating memory on stack
- MAX_LOCAL_BUFFER_LENGTH = MAX_PATH + 1
+ MAX_LOCAL_BUFFER_LENGTH = MAX_PATH_FNAME + 1
};
ILCSTRMarshaler() :
enum
{
// If required buffer length > MAX_LOCAL_BUFFER_LENGTH, don't optimize by allocating memory on stack
- MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH + 1) * 2 + 4
+ MAX_LOCAL_BUFFER_LENGTH = (MAX_PATH_FNAME + 1) * 2 + 4
};
ILBSTRMarshaler() :
CONTRACTL_END;
StackSString path;
- WCHAR pwzPath[MAX_PATH];
- DWORD dwCCPath = MAX_PATH;
+ WCHAR pwzPath[MAX_LONGPATH];
+ DWORD dwCCPath = MAX_LONGPATH;
ReleaseHolder<IAssemblyLocation> pIAssemblyLocation;
IfFailThrow(pNativeFusionAssembly->GetAssemblyLocation(&pIAssemblyLocation));
{
IAssemblyLocation *pIAssemblyLocation = assembly->GetNativeAssemblyLocation();
- WCHAR wzPath[MAX_PATH];
+ WCHAR wzPath[MAX_LONGPATH];
WCHAR *pwzTemp = NULL;
- DWORD dwCCPath = MAX_PATH;
+ DWORD dwCCPath = MAX_LONGPATH;
SString path;
SString moduleName(SString::Utf8, GetSimpleName());
CONTRACTL_END;
DWORD ret;
- DWORD length = MAX_PATH;
+ DWORD length = MAX_LONGPATH;
do
{
WCHAR *buffer = result.OpenUnicodeBuffer(length);
continue;
}
// Because data may be corrupted make sure we null terminate the string.
- pCvInfo->path[MAX_PATH - 1] = '\0';
+ pCvInfo->path[MAX_LONGPATH - 1] = '\0';
//Find the filename from pdb full path
char* fileName = strrchr(pCvInfo->path, '\\');
memmove(pCvInfo->path, fileName, fileNameLenght);
// NULL out the rest of the path buffer.
- for (size_t i = fileNameLenght; i < MAX_PATH - 1; i++)
+ for (size_t i = fileNameLenght; i < MAX_PATH_FNAME - 1; i++)
{
pCvInfo->path[i] = '\0';
}
DWORD magic;
GUID signature; // unique identifier
DWORD age; // an always-incrementing value
- char path[MAX_PATH]; // zero terminated string with the name of the PDB file
+ char path[MAX_LONGPATH]; // zero terminated string with the name of the PDB file
};
typedef DPTR(class PEImage) PTR_PEImage;
if (bTakeOwnership)
{
#ifndef FEATURE_PAL
- WCHAR wszDllName[MAX_PATH];
- WszGetModuleFileName((HMODULE)mapped, wszDllName, MAX_PATH);
- wszDllName[MAX_PATH - 1] = W('\0');
+ WCHAR wszDllName[MAX_LONGPATH];
+ WszGetModuleFileName((HMODULE)mapped, wszDllName, MAX_LONGPATH);
+ wszDllName[MAX_LONGPATH - 1] = W('\0');
m_LibraryHolder=CLRLoadLibraryEx(wszDllName,NULL,GetLoadWithAlteredSearchPathFlag());
#else // !FEATURE_PAL
_ASSERTE(!"bTakeOwnership Should not be used on FEATURE_PAL");
m_ErrorEncountered = false;
// Build the path to the map file on disk.
- WCHAR tempPath[MAX_PATH+1];
- if(!GetTempPathW(MAX_PATH, tempPath))
+ WCHAR tempPath[MAX_LONGPATH+1];
+ if(!GetTempPathW(MAX_LONGPATH, tempPath))
{
return;
}
}
CONTRACTL_END;
- WCHAR wszRuntimeVersion[MAX_PATH];
+ WCHAR wszRuntimeVersion[MAX_PATH_FNAME];
DWORD dwSize = _countof(wszRuntimeVersion);
HRESULT hr = GetCORVersionInternal(wszRuntimeVersion, dwSize, &dwSize);
if (FAILED(hr))
CLSID m_clsidProfiler;
// The path to the profiler's COM object to load
- WCHAR m_wszProfilerPath[MAX_PATH];
+ WCHAR m_wszProfilerPath[MAX_LONGPATH];
// Client data is custom data that the profiler's
// trigger-process wishes to copy into this process.
return E_INVALIDARG;
}
- if ((wszProfilerPath != NULL) && (wcslen(wszProfilerPath) >= MAX_PATH))
+ if ((wszProfilerPath != NULL) && (wcslen(wszProfilerPath) >= MAX_LONGPATH))
{
return E_INVALIDARG;
}
return S_FALSE;
}
- if ((wszProfilerDLL != NULL) && (wcslen(wszProfilerDLL) >= MAX_PATH))
+ if ((wszProfilerDLL != NULL) && (wcslen(wszProfilerDLL) >= MAX_LONGPATH))
{
LOG((LF_CORPROF, LL_INFO10, "**PROF: Profiling flag set, but COR_PROFILER_PATH was not set properly.\n"));
CONTRACTL_END;
static LPWSTR wszModuleName = NULL;
- static WCHAR rgwModuleName[MAX_PATH] = {0};
+ static WCHAR rgwModuleName[MAX_LONGPATH] = {0};
if (wszModuleName == NULL)
{
WCHAR rgwTempName[MAX_PATH] = {0};
- DWORD dwTempNameSize = MAX_PATH;
+ DWORD dwTempNameSize = MAX_LONGPATH;
// Leaves trailing backslash on path, producing something like "c:\windows\microsoft.net\framework\v4.0.x86dbg\"
HRESULT hr = GetInternalSystemDirectory(rgwTempName, &dwTempNameSize);
//finish creating complete path and copy to buffer if we can
if (FAILED(hr) ||
- (wcscat_s(rgwTempName, MAX_PATH, MAIN_DAC_MODULE_DLL_NAME_W) != 0) ||
- (wcscpy_s(rgwModuleName, MAX_PATH, rgwTempName) != 0))
+ (wcscat_s(rgwTempName, MAX_LONGPATH, MAIN_DAC_MODULE_DLL_NAME_W) != 0) ||
+ (wcscpy_s(rgwModuleName, MAX_LONGPATH, rgwTempName) != 0))
{ // The CLR should become unavailable in this case.
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);
}
BEGIN_QCALL;
- WCHAR machine[MAX_PATH];
+ WCHAR machine[MAX_LONGPATH];
- HRESULT hr = GetMachineDirectory(machine, MAX_PATH);
+ HRESULT hr = GetMachineDirectory(machine, MAX_LONGPATH);
if (FAILED(hr))
ThrowHR(hr);
BEGIN_QCALL;
- WCHAR user[MAX_PATH];
+ WCHAR user[MAX_LONGPATH];
- BOOL result = GetUserDirectory(user, MAX_PATH);
+ BOOL result = GetUserDirectory(user, MAX_LONGPATH);
if (result)
retDirectory.Set(user);
{
STANDARD_VM_CONTRACT;
- WCHAR scratchBuffer[MAX_PATH];
+ WCHAR scratchBuffer[MAX_LONGPATH];
BOOL retval = FALSE;
- DWORD size = MAX_PATH;
+ DWORD size = MAX_LONGPATH;
if (!GetUserDir(buffer, bufferCount, TRUE))
goto CLEANUP;
{
// Note: These buffers should be at least as big as the longest possible
// string that will be placed into them by the code below.
- const size_t cchcache = MAX_PATH + sizeof( W("defaultusersecurity.config.cch") ) / sizeof( WCHAR ) + 1;
- const size_t cchconfig = MAX_PATH + sizeof( W("defaultusersecurity.config.cch") ) / sizeof( WCHAR ) + 1;
+ const size_t cchcache = MAX_LONGPATH + sizeof( W("defaultusersecurity.config.cch") ) / sizeof( WCHAR ) + 1;
+ const size_t cchconfig = MAX_LONGPATH + sizeof( W("defaultusersecurity.config.cch") ) / sizeof( WCHAR ) + 1;
NewArrayHolder<WCHAR> cache(new WCHAR[cchcache]);
NewArrayHolder<WCHAR> config(new WCHAR[cchconfig]);
- HRESULT hr = SecurityConfig::GetMachineDirectory(config, MAX_PATH);
+ HRESULT hr = SecurityConfig::GetMachineDirectory(config, MAX_LONGPATH);
if (FAILED(hr))
ThrowHR(hr);
wcscat_s( cache, cchcache, W(".cch") );
SecurityConfig::InitData( SecurityConfig::MachinePolicyLevel, config, cache );
- hr = SecurityConfig::GetMachineDirectory(config, MAX_PATH);
+ hr = SecurityConfig::GetMachineDirectory(config, MAX_LONGPATH);
if (FAILED(hr))
ThrowHR(hr);
wcscat_s( cache, cchcache, W(".cch") );
SecurityConfig::InitData( SecurityConfig::EnterprisePolicyLevel, config, cache );
- BOOL result = SecurityConfig::GetUserDirectory(config, MAX_PATH);
+ BOOL result = SecurityConfig::GetUserDirectory(config, MAX_LONGPATH);
if (result) {
wcscat_s( config, cchconfig, W("security.config") );
wcscpy_s( cache, cchcache, config );
BEGIN_QCALL;
#if !defined(PLATFORM_UNIX)
- WCHAR wszBuffer[MAX_PATH + 1];
+ WCHAR wszBuffer[MAX_LONGPATH + 1];
ZeroMemory(wszBuffer, sizeof(wszBuffer));
- if (SecurityPolicy::GetLongPathNameHelper( wszPath, wszBuffer, MAX_PATH ) != 0)
+ if (SecurityPolicy::GetLongPathNameHelper( wszPath, wszBuffer, MAX_LONGPATH ) != 0)
{
retLongPath.Set( wszBuffer );
}
// trying GetLongPathName on every subdirectory until
// it succeeds or we run out of string.
- WCHAR wszIntermediateBuffer[MAX_PATH];
+ WCHAR wszIntermediateBuffer[MAX_LONGPATH];
- if (wcslen( wszShortPath ) >= MAX_PATH)
+ if (wcslen( wszShortPath ) >= MAX_LONGPATH)
return 0;
wcscpy_s( wszIntermediateBuffer, COUNTOF(wszIntermediateBuffer), wszShortPath );
#pragma prefast(pop)
#endif
- size = WszGetLongPathName(wszIntermediateBuffer, wszBuffer, MAX_PATH);
+ size = WszGetLongPathName(wszIntermediateBuffer, wszBuffer, MAX_LONGPATH);
if (size != 0)
{
size_t sizeBuffer = wcslen( wszBuffer );
- if (sizeBuffer + wcslen( &wszIntermediateBuffer[index] ) > MAX_PATH - 2)
+ if (sizeBuffer + wcslen( &wszIntermediateBuffer[index] ) > MAX_LONGPATH - 2)
{
return 0;
}
return 0;
}
- else if (size > MAX_PATH)
+ else if (size > MAX_LONGPATH)
{
return 0;
}
#if !defined(FEATURE_CORECLR)
BEGIN_QCALL;
- WCHAR networkName[MAX_PATH];
- DWORD networkNameSize = MAX_PATH;
+ WCHAR networkName[MAX_LONGPATH];
+ DWORD networkNameSize = MAX_LONGPATH;
ZeroMemory( networkName, sizeof( networkName ) );
UINT driveType = WszGetDriveType( wszDriveLetter );
// Win2K: passing in too long a filename triggers a nasty buffer overrun bug
// when the SaveAll() method is called. We'll avoid triggering this here.
//
- if (wcslen(szTlbName) > MAX_PATH)
+ if (wcslen(szTlbName) > MAX_PATH_FNAME)
IfFailReport(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE));
// Reverting to old behavior here until we can fix up the vtable offsets as well.
HANDLE hToken,
DWORD dwFlags,
size_t cchPathMax,
- __out_ecount(MAX_PATH) LPWSTR pwszPath)
+ __out_ecount(MAX_LONGPATH) LPWSTR pwszPath)
{
CONTRACTL
{
}
CONTRACTL_END;
- // SHGetFolderPath requirement: path buffer >= MAX_PATH chars
- _ASSERTE(cchPathMax >= MAX_PATH);
+ // SHGetFolderPath requirement: path buffer >= MAX_LONGPATH chars
+ _ASSERTE(cchPathMax >= MAX_LONGPATH);
HRESULT hr;
ULONG maxLength = MAX_PATH;
}
CONTRACTL_END;
- WCHAR defaultPath[MAX_PATH];
+ WCHAR defaultPath[MAX_LONGPATH];
HRESULT hr;
HANDLE hToken;
hToken = (HANDLE)(-1);
- hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA, hToken, SHGFP_TYPE_CURRENT, MAX_PATH, defaultPath);
+ hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA, hToken, SHGFP_TYPE_CURRENT, MAX_LONGPATH, defaultPath);
if (FAILED(hr))
{
- hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA, hToken, SHGFP_TYPE_DEFAULT, MAX_PATH, defaultPath);
+ hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA, hToken, SHGFP_TYPE_DEFAULT, MAX_LONGPATH, defaultPath);
}
if (FAILED(hr))
return FALSE;
// In Windows ME, there is currently a bug that makes local appdata and roaming appdata
// point to the same location, so we've decided to "do our own thing" and add \Local Settings before \Application Data
if (!fRoaming) {
- WCHAR appdatafolder[MAX_PATH];
- hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, MAX_PATH, appdatafolder);
+ WCHAR appdatafolder[MAX_LONGPATH];
+ hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, MAX_LONGPATH, appdatafolder);
if (FAILED(hr))
{
- hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, MAX_PATH, appdatafolder);
+ hr = WszSHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, MAX_LONGPATH, appdatafolder);
}
if (FAILED(hr))
return FALSE;
if (!wcscmp(appdatafolder, buffer))
{
- WCHAR tempPartialPath[MAX_PATH];
+ WCHAR tempPartialPath[MAX_LONGPATH];
ULONG slen = (ULONG)wcslen(buffer);
if (buffer[slen - 1] == W('\\'))
}
CONTRACTL_END;
- _ASSERTE( bufferCount == MAX_PATH && "You should pass in a buffer of size MAX_PATH" );
+ _ASSERTE( bufferCount == MAX_LONGPATH && "You should pass in a buffer of size MAX_LONGPATH" );
HRESULT hr = WszSHGetFolderPath( NULL, CSIDL_INTERNET_CACHE, NULL, SHGFP_TYPE_CURRENT, bufferCount, buffer );
if (FAILED(hr))
#ifndef FEATURE_PAL
-HRESULT WszSHGetFolderPath(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, size_t cchPath, __out_ecount(MAX_PATH) LPWSTR pszwPath);
+HRESULT WszSHGetFolderPath(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, size_t cchPath, __out_ecount(MAX_LONGPATH) LPWSTR pszwPath);
HRESULT WszShellExecute(HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd);
#ifndef DACCESS_COMPILE
// Therefore we do not have to use file name to create fake type name
IfFailRet(GetFirstWinRTTypeDef(pMDInternalImport, &szNameSpace, &szTypeName, NULL, NULL));
- DWORD dwSize = MAX_PATH;
- WCHAR wzAsmName[MAX_PATH];
+ DWORD dwSize = MAX_PATH_FNAME;
+ WCHAR wzAsmName[MAX_PATH_FNAME];
- dwSize = MAX_PATH * sizeof(WCHAR);
+ dwSize = MAX_PATH_FNAME * sizeof(WCHAR);
IfFailRet(pIAssemblyName->GetProperty(ASM_NAME_NAME, wzAsmName, &dwSize));
StackSString sNamespaceAndType(wzAsmName);