summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Zhang (CLR) <yzha@microsoft.com>2016-05-03 23:02:10 -0700
committerYi Zhang <yzha@microsoft.com>2016-05-16 22:46:58 -0700
commit8c85c81d4a0cb4d2ba9fd14fdcbce51c9d715e25 (patch)
treecd1e2006cac6e84025f1d87dabb919debda33b63
parent97b4ff0b438261ba11b357008630076054a6f25d (diff)
downloadcoreclr-8c85c81d4a0cb4d2ba9fd14fdcbce51c9d715e25.tar.gz
coreclr-8c85c81d4a0cb4d2ba9fd14fdcbce51c9d715e25.tar.bz2
coreclr-8c85c81d4a0cb4d2ba9fd14fdcbce51c9d715e25.zip
Enable DefaultDllImportSearchPathsAttribute in CoreCLR Windows. Host NATIVE_DLL_SEARCH_DIRECTORIES has higher priority.
-rw-r--r--src/debug/daccess/nidump.cpp2
-rw-r--r--src/vm/ceeload.cpp4
-rw-r--r--src/vm/ceeload.h4
-rw-r--r--src/vm/dllimport.cpp13
-rw-r--r--src/vm/interoputil.cpp2
-rw-r--r--src/vm/interoputil.h2
-rw-r--r--src/vm/method.cpp4
-rw-r--r--src/vm/method.hpp8
8 files changed, 6 insertions, 33 deletions
diff --git a/src/debug/daccess/nidump.cpp b/src/debug/daccess/nidump.cpp
index 29c326debe..a3a454384c 100644
--- a/src/debug/daccess/nidump.cpp
+++ b/src/debug/daccess/nidump.cpp
@@ -4133,10 +4133,8 @@ void NativeImageDumper::DumpModule( PTR_Module module )
//file
//assembly
-#if !defined(FEATURE_CORECLR)
DisplayWriteFieldInt( m_DefaultDllImportSearchPathsAttributeValue,
module->m_DefaultDllImportSearchPathsAttributeValue, Module, MODULE );
-#endif // !FEATURE_CORECLR
DisplayEndStructure(MODULE); //Module
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp
index db2bc6df3b..6dab63eefd 100644
--- a/src/vm/ceeload.cpp
+++ b/src/vm/ceeload.cpp
@@ -3022,7 +3022,6 @@ BOOL Module::GetNeutralResourcesLanguage(LPCUTF8 * cultureName, ULONG * cultureN
}
-#ifndef FEATURE_CORECLR
BOOL Module::HasDefaultDllImportSearchPathsAttribute()
{
CONTRACTL
@@ -3052,7 +3051,6 @@ BOOL Module::HasDefaultDllImportSearchPathsAttribute()
return (m_dwPersistedFlags & DEFAULT_DLL_IMPORT_SEARCH_PATHS_STATUS) != 0 ;
}
-#endif // !FEATURE_CORECLR
// Returns a BOOL to indicate if we have computed whether compiler has instructed us to
// wrap the non-CLS compliant exceptions or not.
@@ -9948,9 +9946,7 @@ void Module::Save(DataImage *image)
GetReliabilityContract();
IsPreV4Assembly();
-#ifndef FEATURE_CORECLR
HasDefaultDllImportSearchPathsAttribute();
-#endif
// Precompute property information to avoid runtime metadata lookup
PopulatePropertyInfoMap();
diff --git a/src/vm/ceeload.h b/src/vm/ceeload.h
index 7f85d705e0..353be2d073 100644
--- a/src/vm/ceeload.h
+++ b/src/vm/ceeload.h
@@ -1599,9 +1599,7 @@ private:
// IL stub cache with fabricated MethodTable parented by this module.
ILStubCache *m_pILStubCache;
-#ifndef FEATURE_CORECLR
ULONG m_DefaultDllImportSearchPathsAttributeValue;
-#endif
LPCUTF8 m_pszCultureName;
ULONG m_CultureNameLength;
@@ -3353,7 +3351,6 @@ public:
//-----------------------------------------------------------------------------------------
BOOL IsRuntimeWrapExceptions();
-#ifndef FEATURE_CORECLR
BOOL HasDefaultDllImportSearchPathsAttribute();
BOOL IsDefaultDllImportSearchPathsAttributeCached()
@@ -3373,7 +3370,6 @@ public:
LIMITED_METHOD_CONTRACT;
return (m_DefaultDllImportSearchPathsAttributeValue & 0x2) != 0;
}
-#endif // !FEATURE_CORECLR
//-----------------------------------------------------------------------------------------
// True iff metadata version string is 1.* or 2.*.
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index 9d5d27f69f..574e32a3e4 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -6563,7 +6563,6 @@ private:
DWORD m_priorityOfLastError;
}; // class LoadLibErrorTracker
-
// Local helper function for the LoadLibraryModule function below
static HMODULE LocalLoadLibraryHelper( LPCWSTR name, DWORD flags, LoadLibErrorTracker *pErrorTracker )
{
@@ -6572,14 +6571,14 @@ static HMODULE LocalLoadLibraryHelper( LPCWSTR name, DWORD flags, LoadLibErrorTr
HMODULE hmod = NULL;
#ifndef FEATURE_PAL
-
+
if ((flags & 0xFFFFFF00) != 0
#ifndef FEATURE_CORESYSTEM
&& NDirect::SecureLoadLibrarySupported()
#endif // !FEATURE_CORESYSTEM
)
{
- hmod = CLRLoadLibraryEx( name, NULL, flags & 0xFFFFFF00);
+ hmod = CLRLoadLibraryEx(name, NULL, flags & 0xFFFFFF00);
if(hmod != NULL)
{
return hmod;
@@ -6594,11 +6593,11 @@ static HMODULE LocalLoadLibraryHelper( LPCWSTR name, DWORD flags, LoadLibErrorTr
}
hmod = CLRLoadLibraryEx(name, NULL, flags & 0xFF);
-
+
#else // !FEATURE_PAL
hmod = CLRLoadLibrary(name);
#endif // !FEATURE_PAL
-
+
if (hmod == NULL)
{
pErrorTracker->TrackErrorCode(GetLastError());
@@ -7047,7 +7046,6 @@ HINSTANCE NDirect::LoadLibraryModule(NDirectMethodDesc * pMD, LoadLibErrorTracke
bool libNameIsRelativePath = Path::IsRelative(wszLibName);
if (hmod == NULL)
{
-#ifndef FEATURE_CORECLR
// First checks if the method has DefaultDllImportSearchPathsAttribute. If method has the attribute
// then dllImportSearchPathFlag is set to its value.
// Otherwise checks if the assembly has the attribute.
@@ -7072,11 +7070,12 @@ HINSTANCE NDirect::LoadLibraryModule(NDirectMethodDesc * pMD, LoadLibErrorTracke
}
}
+#ifndef FEATURE_CORECLR
if (!attributeIsFound)
{
CheckUnificationList(pMD, &dllImportSearchPathFlag, &searchAssemblyDirectory);
}
-#endif // !FEATURE_CORECLR
+#endif
if (!libNameIsRelativePath)
{
diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp
index 011c9d5060..33f04b9ab8 100644
--- a/src/vm/interoputil.cpp
+++ b/src/vm/interoputil.cpp
@@ -908,7 +908,6 @@ void FillExceptionData(ExceptionData* pedata, IErrorInfo* pErrInfo, IRestrictedE
}
#endif // CROSSGEN_COMPILE
-#ifndef FEATURE_CORECLR
//---------------------------------------------------------------------------
//returns true if pImport has DefaultDllImportSearchPathsAttribute
//if true, also returns dllImportSearchPathFlag and searchAssemblyDirectory values.
@@ -945,7 +944,6 @@ BOOL GetDefaultDllImportSearchPathsAttributeValue(IMDInternalImport *pImport, md
*pDllImportSearchPathFlag = args[0].val.u4;
return TRUE;
}
-#endif // !FEATURE_CORECLR
//---------------------------------------------------------------------------
diff --git a/src/vm/interoputil.h b/src/vm/interoputil.h
index 754c20f0dd..6762c80f92 100644
--- a/src/vm/interoputil.h
+++ b/src/vm/interoputil.h
@@ -129,12 +129,10 @@ void FillExceptionData(ExceptionData* pedata, IErrorInfo* pErrInfo, IRestrictedE
// helper to access fields from an object
INT64 FieldAccessor(FieldDesc* pFD, OBJECTREF oref, INT64 val, BOOL isGetter, U1 cbSize);
-#ifndef FEATURE_CORECLR
//---------------------------------------------------------------------------
//returns true if pImport has DefaultDllImportSearchPathsAttribute
//if true, also returns dllImportSearchPathFlag and searchAssemblyDirectory values.
BOOL GetDefaultDllImportSearchPathsAttributeValue(IMDInternalImport *pImport, mdToken token, DWORD * pDlImportSearchPathFlag);
-#endif // !FEATURE_CORECLR
//---------------------------------------------------------------------------
// Returns the index of the LCID parameter if one exists and -1 otherwise.
diff --git a/src/vm/method.cpp b/src/vm/method.cpp
index 1c7fce9c3a..70714b710d 100644
--- a/src/vm/method.cpp
+++ b/src/vm/method.cpp
@@ -139,7 +139,6 @@ BOOL MethodDesc::IsIntrospectionOnly()
}
/*********************************************************************/
-#ifndef FEATURE_CORECLR
#ifndef DACCESS_COMPILE
BOOL NDirectMethodDesc::HasDefaultDllImportSearchPathsAttribute()
{
@@ -172,7 +171,6 @@ BOOL NDirectMethodDesc::HasDefaultDllImportSearchPathsAttribute()
return (ndirect.m_wFlags & kDefaultDllImportSearchPathsStatus) != 0;
}
#endif //!DACCESS_COMPILE
-#endif // !FEATURE_CORECLR
//*******************************************************************************
#ifndef DACCESS_COMPILE
@@ -3111,13 +3109,11 @@ void MethodDesc::Save(DataImage *image)
// Make sure that the marshaling required flag is computed
pNMD->MarshalingRequired();
-#ifndef FEATURE_CORECLR
if (!pNMD->IsQCall())
{
//Cache DefaultImportDllImportSearchPaths attribute.
pNMD->HasDefaultDllImportSearchPathsAttribute();
}
-#endif
image->StoreStructure(pNMD->GetWriteableData(),
sizeof(NDirectWriteableData),
diff --git a/src/vm/method.hpp b/src/vm/method.hpp
index 0cdba004e1..5c73827a61 100644
--- a/src/vm/method.hpp
+++ b/src/vm/method.hpp
@@ -2553,9 +2553,7 @@ public:
NDirectImportThunkGlue m_ImportThunkGlue;
#endif // HAS_NDIRECT_IMPORT_PRECODE
-#ifndef FEATURE_CORECLR
ULONG m_DefaultDllImportSearchPathsAttributeValue; // DefaultDllImportSearchPathsAttribute is saved.
-#endif
// Various attributes needed at runtime.
WORD m_wFlags;
@@ -2588,9 +2586,7 @@ public:
kHasSuppressUnmanagedCodeAccess = 0x0002,
-#ifndef FEATURE_CORECLR
kDefaultDllImportSearchPathsIsCached = 0x0004, // set if we cache attribute value.
-#endif
// kUnusedMask = 0x0008
@@ -2614,9 +2610,7 @@ public:
kIsQCall = 0x1000,
-#if !defined(FEATURE_CORECLR)
kDefaultDllImportSearchPathsStatus = 0x2000, // either method has custom attribute or not.
-#endif
kHasCopyCtorArgs = 0x4000,
@@ -2749,7 +2743,6 @@ public:
return (ndirect.m_wFlags & kIsQCall) != 0;
}
-#ifndef FEATURE_CORECLR
BOOL HasDefaultDllImportSearchPathsAttribute();
BOOL IsDefaultDllImportSearchPathsAttributeCached()
@@ -2769,7 +2762,6 @@ public:
LIMITED_METHOD_CONTRACT;
return (ndirect.m_DefaultDllImportSearchPathsAttributeValue & 0x2) != 0;
}
-#endif // !FEATURE_CORECLR
BOOL HasCopyCtorArgs() const
{