diff options
author | John Chen (JOCHEN7) <jochen@microsoft.com> | 2016-02-23 20:36:07 -0800 |
---|---|---|
committer | John Chen (JOCHEN7) <jochen@microsoft.com> | 2016-02-29 13:55:49 -0800 |
commit | 488e6a16685241ed1aed3b3d386b78ed32e428f0 (patch) | |
tree | 9fd979bdde69b08216c6dde6a466fa3ff519c775 /src/binder | |
parent | 2d98b6a53263b9ad4b98e4a5dee35e703fd7ddf5 (diff) | |
download | coreclr-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/binder')
-rw-r--r-- | src/binder/assemblybinder.cpp | 11 | ||||
-rw-r--r-- | src/binder/cdebuglog.cpp | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/binder/assemblybinder.cpp b/src/binder/assemblybinder.cpp index 1e68e55002..1e760ee80a 100644 --- a/src/binder/assemblybinder.cpp +++ b/src/binder/assemblybinder.cpp @@ -173,9 +173,18 @@ namespace BINDER_SPACE dwCCFullAssemblyPath, pwzFullAssemblyPath, NULL); + if (dwCCFullAssemblyPath > MAX_LONGPATH) + { + fullAssemblyPath.CloseBuffer(); + pwzFullAssemblyPath = fullAssemblyPath.OpenUnicodeBuffer(dwCCFullAssemblyPath - 1); + dwCCFullAssemblyPath = WszGetFullPathName(assemblyPath.GetUnicode(), + dwCCFullAssemblyPath, + pwzFullAssemblyPath, + NULL); + } fullAssemblyPath.CloseBuffer(dwCCFullAssemblyPath); - if ((dwCCFullAssemblyPath == 0) || (dwCCFullAssemblyPath > (MAX_LONGPATH + 1))) + if (dwCCFullAssemblyPath == 0) { hr = HRESULT_FROM_GetLastError(); } diff --git a/src/binder/cdebuglog.cpp b/src/binder/cdebuglog.cpp index 98b9589240..3724f9ec8e 100644 --- a/src/binder/cdebuglog.cpp +++ b/src/binder/cdebuglog.cpp @@ -58,12 +58,6 @@ namespace BINDER_SPACE PathString szPathString; DWORD dw = 0; - // _ASSERTE (pszPath ) ; - if (wcslen(pszName) >= MAX_LONGPATH) - { - IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_BUFFER_OVERFLOW)); - } - size_t pszNameLen = wcslen(pszName); WCHAR * szPath = szPathString.OpenUnicodeBuffer(static_cast<COUNT_T>(pszNameLen)); size_t cbSzPath = (sizeof(WCHAR)) * (pszNameLen + 1); // SString allocates extra byte for null |