summaryrefslogtreecommitdiff
path: root/src/vm/compile.cpp
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2016-09-23 17:39:43 -0700
committerGitHub <noreply@github.com>2016-09-23 17:39:43 -0700
commit10b964f1beab13479c223f594cdd55a6e583eb3e (patch)
tree0a06b6da1e5ee396a0dcb177d5e75209d06926e8 /src/vm/compile.cpp
parentecb241f8d30b3251ca8f8e267d17f7fe36224b8f (diff)
downloadcoreclr-10b964f1beab13479c223f594cdd55a6e583eb3e.tar.gz
coreclr-10b964f1beab13479c223f594cdd55a6e583eb3e.tar.bz2
coreclr-10b964f1beab13479c223f594cdd55a6e583eb3e.zip
Remove CoreCLR's dependency on the diasymreader.dll installed as part of the full .NET Framework on Desktop (#7336)
* Remove CoreCLR's dependency on the diasymreader.dll installed as part of the full .NET Framework on Desktop Issue #5922 * Code review feedback.
Diffstat (limited to 'src/vm/compile.cpp')
-rw-r--r--src/vm/compile.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp
index 4aefe2f4e9..50a2412904 100644
--- a/src/vm/compile.cpp
+++ b/src/vm/compile.cpp
@@ -2909,36 +2909,44 @@ public:
{
LIMITED_METHOD_CONTRACT;
}
-
+
+#ifdef FEATURE_CORECLR
+#define WRITER_LOAD_ERROR_MESSAGE W("Unable to load ") NATIVE_SYMBOL_READER_DLL W(". Please ensure that ") NATIVE_SYMBOL_READER_DLL W(" is on the path. Error='%d'\n")
+#else
+#define WRITER_LOAD_ERROR_MESSAGE W("Unable to load diasymreader.dll. Please ensure that version 11 or greater of diasymreader.dll is on the path. You can typically find this DLL in the desktop .NET install directory for 4.5 or greater. Error='%d'\n")
+#endif
+
HRESULT Load(LPCWSTR wszDiasymreaderPath = nullptr)
{
STANDARD_VM_CONTRACT;
HRESULT hr = S_OK;
- m_hModule = WszLoadLibrary(wszDiasymreaderPath != nullptr ? wszDiasymreaderPath : W("diasymreader.dll"));
+ m_hModule = WszLoadLibrary(wszDiasymreaderPath != nullptr ? wszDiasymreaderPath : (LPCWSTR)NATIVE_SYMBOL_READER_DLL);
if (m_hModule == NULL)
{
- GetSvcLogger()->Printf(
- W("Unable to load diasymreader.dll. Please ensure that version 11 or greater of diasymreader.dll is on the path. You can typically find this DLL in the desktop .NET install directory for 4.5 or greater. Error='%d'\n"),
- GetLastError());
- return HRESULT_FROM_WIN32(GetLastError());
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ GetSvcLogger()->Printf(WRITER_LOAD_ERROR_MESSAGE, GetLastError());
+ return hr;
}
m_Create = reinterpret_cast<CreateNGenPdbWriter_t>(GetProcAddress(m_hModule, "CreateNGenPdbWriter"));
if (m_Create == NULL)
{
- GetSvcLogger()->Printf(
- W("An incorrect version of diasymreader.dll was found. Please ensure that version 11 or greater of diasymreader.dll is on the path. You can typically find this DLL in the desktop .NET install directory for 4.5 or greater. Error='%d'\n"),
- GetLastError());
- return HRESULT_FROM_WIN32(GetLastError());
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ GetSvcLogger()->Printf(WRITER_LOAD_ERROR_MESSAGE, GetLastError());
+ return hr;
}
if ((m_dwExtraData & kPDBLines) != 0)
{
hr = FakeCoCreateInstanceEx(
CLSID_CorSymBinder_SxS,
- NULL,
+#ifdef FEATURE_CORECLR
+ wszDiasymreaderPath != nullptr ? wszDiasymreaderPath : (LPCWSTR)NATIVE_SYMBOL_READER_DLL,
+#else
+ wszDiasymreaderPath,
+#endif
IID_ISymUnmanagedBinder,
(void**)&m_pBinder,
NULL);