summaryrefslogtreecommitdiff
path: root/src/debug/di/shimprocess.cpp
diff options
context:
space:
mode:
authorRama Krishnan Raghupathy <ramarag@microsoft.com>2016-02-18 18:21:18 -0800
committerRama Krishnan Raghupathy <ramarag@microsoft.com>2016-02-19 18:09:11 -0800
commitf98fb85e72d0f24c58d9e54b8b3bff2c67f985fb (patch)
treea532e7803fbbe420807eb7d9390108554b02c46d /src/debug/di/shimprocess.cpp
parent01ffa08a2e4748e9826956ea961eacb227b6ee87 (diff)
downloadcoreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.tar.gz
coreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.tar.bz2
coreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.zip
This Change Adds initial Support for LongFiles in the VM,
They are: 1. Wrappers for OS APIs which take or return PATHS 2. Fixing the usage of following Api's: GetEnvironmentVariableW SearchPathW GetShortPathNameW GetLongPathNameW GetModuleFileName Work remaining: Remove fixed size buffers in the VM
Diffstat (limited to 'src/debug/di/shimprocess.cpp')
-rw-r--r--src/debug/di/shimprocess.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/debug/di/shimprocess.cpp b/src/debug/di/shimprocess.cpp
index f15ab3fff6..a6fc15407e 100644
--- a/src/debug/di/shimprocess.cpp
+++ b/src/debug/di/shimprocess.cpp
@@ -1823,50 +1823,41 @@ HRESULT ShimProcess::FindLoadedCLR(CORDB_ADDRESS * pClrInstanceId)
HMODULE ShimProcess::GetDacModule()
{
HModuleHolder hDacDll;
- WCHAR wszAccessDllPath[MAX_LONGPATH];
+ PathString wszAccessDllPath;
#ifdef FEATURE_PAL
- if (!PAL_GetPALDirectoryW(wszAccessDllPath, _countof(wszAccessDllPath)))
+ if (!PAL_GetPALDirectoryWrapper(wszAccessDllPath))
{
ThrowLastError();
}
- wcscat_s(wszAccessDllPath, _countof(wszAccessDllPath), MAKEDLLNAME_W(W("mscordaccore")));
+ PCWSTR eeFlavor = MAKEDLLNAME_W(W("mscordaccore"));
#else
//
// Load the access DLL from the same directory as the the current CLR Debugging Services DLL.
//
- if (!WszGetModuleFileName(GetModuleInst(), wszAccessDllPath, NumItems(wszAccessDllPath)))
+ if (!WszGetModuleFileName(GetModuleInst(), wszAccessDllPath))
{
ThrowLastError();
}
- PWSTR pPathTail = wcsrchr(wszAccessDllPath, DIRECTORY_SEPARATOR_CHAR_W);
- if (!pPathTail)
+ if (!SUCCEEDED(CopySystemDirectory(wszAccessDllPath, wszAccessDllPath)))
{
ThrowHR(E_INVALIDARG);
}
- pPathTail++;
// Dac Dll is named:
// mscordaccore.dll <-- coreclr
// mscordacwks.dll <-- desktop
PCWSTR eeFlavor =
#if defined(FEATURE_MAIN_CLR_MODULE_USES_CORE_NAME)
- W("core");
+ W("mscordaccore.dll");
#else
- W("wks");
+ W("mscordacwks.dll");
#endif
-
- if (_snwprintf_s(pPathTail,
- _countof(wszAccessDllPath) + (wszAccessDllPath - pPathTail),
- NumItems(wszAccessDllPath) - (pPathTail - wszAccessDllPath),
- MAKEDLLNAME_W(W("mscordac%s")),
- eeFlavor) <= 0)
- {
- ThrowHR(E_INVALIDARG);
- }
+
#endif // FEATURE_PAL
+ wszAccessDllPath.Append(eeFlavor);
hDacDll.Assign(WszLoadLibrary(wszAccessDllPath));
if (!hDacDll)