summaryrefslogtreecommitdiff
path: root/src/md
diff options
context:
space:
mode:
authorJohn Chen (JOCHEN7) <jochen@microsoft.com>2016-02-23 20:36:07 -0800
committerJohn Chen (JOCHEN7) <jochen@microsoft.com>2016-02-29 13:55:49 -0800
commit488e6a16685241ed1aed3b3d386b78ed32e428f0 (patch)
tree9fd979bdde69b08216c6dde6a466fa3ff519c775 /src/md
parent2d98b6a53263b9ad4b98e4a5dee35e703fd7ddf5 (diff)
downloadcoreclr-488e6a16685241ed1aed3b3d386b78ed32e428f0.tar.gz
coreclr-488e6a16685241ed1aed3b3d386b78ed32e428f0.tar.bz2
coreclr-488e6a16685241ed1aed3b3d386b78ed32e428f0.zip
Support long paths in CoreCLR runtime on Windows
The CoreCLR runtime is updated to support long file paths on Windows. Pending updates to mscorlib.dll, the following scenarios are supported: * Run managed apps from a long path. * Load CoreCLR runtime and framework from a long path. * Load user assemblies from a long path. * Run CrossGen from a long path, with its input/output from a long path. * Generate debug log file at a long path. The following scenarios are not yet supported, and will be fixed in future commits: * Mscorlib.dll and framework assemblies are not yet long path compatible. Note that until mscorlib.dll is fixed, most of the runtime changes can't actually be used. * Support on non-Windows platforms. * Support for debugging and error reporting. * Tools such as ilasm or ildasm.
Diffstat (limited to 'src/md')
-rw-r--r--src/md/compiler/regmeta_emit.cpp14
-rw-r--r--src/md/enc/liteweightstgdbrw.cpp4
2 files changed, 8 insertions, 10 deletions
diff --git a/src/md/compiler/regmeta_emit.cpp b/src/md/compiler/regmeta_emit.cpp
index 33883107bd..22d2979343 100644
--- a/src/md/compiler/regmeta_emit.cpp
+++ b/src/md/compiler/regmeta_emit.cpp
@@ -67,17 +67,11 @@ STDMETHODIMP RegMeta::SetModuleProps( // S_OK or error.
IfFailGo(m_pStgdb->m_MiniMd.GetModuleRecord(1, &pModule));
if (szName != NULL)
{
- WCHAR rcFile[_MAX_PATH]={0};
- WCHAR rcExt[_MAX_PATH]={0};
- WCHAR rcNewFileName[_MAX_PATH]={0};
+ LPCWSTR szFile = NULL;
+ size_t cchFile;
- // If the total name is less than _MAX_PATH, the components are, too.
- if (wcslen(szName) >= _MAX_PATH)
- IfFailGo(E_INVALIDARG);
-
- SplitPath(szName, NULL, 0, NULL, 0, rcFile, COUNTOF(rcFile), rcExt, COUNTOF(rcExt));
- MakePath(rcNewFileName, NULL, NULL, rcFile, rcExt);
- IfFailGo(m_pStgdb->m_MiniMd.PutStringW(TBL_Module, ModuleRec::COL_Name, pModule, rcNewFileName));
+ SplitPathInterior(szName, NULL, 0, NULL, 0, &szFile, &cchFile, NULL, 0);
+ IfFailGo(m_pStgdb->m_MiniMd.PutStringW(TBL_Module, ModuleRec::COL_Name, pModule, szFile));
}
IfFailGo(UpdateENCLog(TokenFromRid(1, mdtModule)));
diff --git a/src/md/enc/liteweightstgdbrw.cpp b/src/md/enc/liteweightstgdbrw.cpp
index 667f24a312..12779f59c0 100644
--- a/src/md/enc/liteweightstgdbrw.cpp
+++ b/src/md/enc/liteweightstgdbrw.cpp
@@ -1251,6 +1251,9 @@ BOOL
CLiteWeightStgdbRW::IsValidFileNameLength(
const WCHAR * wszFileName)
{
+#ifdef FEATURE_CORECLR
+ return TRUE;
+#else
static const WCHAR const_wszLongPathPrefix[] = W("\\\\?\\");
if (wszFileName == NULL)
@@ -1271,4 +1274,5 @@ CLiteWeightStgdbRW::IsValidFileNameLength(
return TRUE;
}
return FALSE;
+#endif
} // CLiteWeightStgdbRW::IsValidFileNameLength