Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/coreclr/binder/applicationcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ namespace BINDER_SPACE
HRESULT ApplicationContext::SetupBindingPaths(SString &sTrustedPlatformAssemblies,
SString &sPlatformResourceRoots,
SString &sAppPaths,
SString &sAppNiPaths,
BOOL fAcquireLock)
{
HRESULT hr = S_OK;
Expand Down Expand Up @@ -219,31 +218,6 @@ namespace BINDER_SPACE
m_appPaths.Append(pathName);
}

//
// Parse AppNiPaths
//
sAppNiPaths.Normalize();
for (SString::Iterator i = sAppNiPaths.Begin(); i != sAppNiPaths.End(); )
{
SString pathName;
HRESULT pathResult = S_OK;

IF_FAIL_GO(pathResult = GetNextPath(sAppNiPaths, i, pathName));
if (pathResult == S_FALSE)
{
break;
}

#ifndef CROSSGEN_COMPILE
if (Path::IsRelative(pathName))
{
GO_WITH_HRESULT(E_INVALIDARG);
}
#endif

m_appNiPaths.Append(pathName);
}

Exit:
return hr;
}
Expand Down
28 changes: 9 additions & 19 deletions src/coreclr/binder/assemblybindercommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,10 @@ namespace BINDER_SPACE
HRESULT BindAssemblyByProbingPaths(
const StringArrayList *pBindingPaths,
AssemblyName *pRequestedAssemblyName,
bool useNativeImages,
Assembly **ppAssembly)
{
const SString &simpleName = pRequestedAssemblyName->GetSimpleName();
BinderTracing::PathSource pathSource = useNativeImages ? BinderTracing::PathSource::AppNativeImagePaths : BinderTracing::PathSource::AppPaths;
BinderTracing::PathSource pathSource = BinderTracing::PathSource::AppPaths;
// Loop through the binding paths looking for a matching assembly
for (DWORD i = 0; i < pBindingPaths->GetCount(); i++)
{
Expand All @@ -966,20 +965,20 @@ namespace BINDER_SPACE

// Look for a matching dll first
PathString fileName(fileNameWithoutExtension);
fileName.Append(useNativeImages ? W(".ni.dll") : W(".dll"));
fileName.Append(W(".dll"));
hr = AssemblyBinderCommon::GetAssembly(fileName,
FALSE, // fIsInTPA
useNativeImages, // fExplicitBindToNativeImage
FALSE, // fExplicitBindToNativeImage
&pAssembly);
BinderTracing::PathProbed(fileName, pathSource, hr);

if (FAILED(hr))
{
fileName.Set(fileNameWithoutExtension);
fileName.Append(useNativeImages ? W(".ni.exe") : W(".exe"));
fileName.Append(W(".exe"));
hr = AssemblyBinderCommon::GetAssembly(fileName,
FALSE, // fIsInTPA
useNativeImages, // fExplicitBindToNativeImage
FALSE, // fExplicitBindToNativeImage
&pAssembly);
BinderTracing::PathProbed(fileName, pathSource, hr);
}
Expand Down Expand Up @@ -1028,9 +1027,8 @@ namespace BINDER_SPACE
* a set of folders configured by the host.
*
* If a requested assembly identity cannot be found in the TPA list or the resource roots,
* it is considered an application assembly. We probe for application assemblies in one of two
* sets of paths: the AppNiPaths, a list of paths containing native images, and the AppPaths, a
* list of paths containing IL files and satellite resource folders.
* it is considered an application assembly. We probe for application assemblies in the
* AppPaths, a list of paths containing IL files and satellite resource folders.
*
*/
/* static */
Expand Down Expand Up @@ -1157,19 +1155,11 @@ namespace BINDER_SPACE

if (!excludeAppPaths)
{
// Probe AppNiPaths first, then AppPaths
// Probe AppPaths
ReleaseHolder<Assembly> pAssembly;
hr = BindAssemblyByProbingPaths(pApplicationContext->GetAppNiPaths(),
hr = BindAssemblyByProbingPaths(pApplicationContext->GetAppPaths(),
pRequestedAssemblyName,
true, // useNativeImages
&pAssembly);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
hr = BindAssemblyByProbingPaths(pApplicationContext->GetAppPaths(),
pRequestedAssemblyName,
false, // useNativeImages
&pAssembly);
}

pBindResult->SetAttemptResult(hr, pAssembly);
if (hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/binder/defaultassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,13 @@ Exit:;

HRESULT DefaultAssemblyBinder::SetupBindingPaths(SString &sTrustedPlatformAssemblies,
SString &sPlatformResourceRoots,
SString &sAppPaths,
SString &sAppNiPaths)
SString &sAppPaths)
{
HRESULT hr = S_OK;

EX_TRY
{
hr = GetAppContext()->SetupBindingPaths(sTrustedPlatformAssemblies, sPlatformResourceRoots, sAppPaths, sAppNiPaths, TRUE /* fAcquireLock */);
hr = GetAppContext()->SetupBindingPaths(sTrustedPlatformAssemblies, sPlatformResourceRoots, sAppPaths, TRUE /* fAcquireLock */);
}
EX_CATCH_HRESULT(hr);
return hr;
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/binder/inc/applicationcontext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ namespace BINDER_SPACE
HRESULT SetupBindingPaths(/* in */ SString &sTrustedPlatformAssemblies,
/* in */ SString &sPlatformResourceRoots,
/* in */ SString &sAppPaths,
/* in */ SString &sAppNiPaths,
/* in */ BOOL fAcquireLock);

HRESULT GetAssemblyIdentity(/* in */ LPCSTR szTextualIdentity,
Expand All @@ -106,7 +105,6 @@ namespace BINDER_SPACE
inline StringArrayList *GetAppPaths();
inline SimpleNameToFileNameMap *GetTpaList();
inline StringArrayList *GetPlatformResourceRoots();
inline StringArrayList *GetAppNiPaths();

// Using a host-configured Trusted Platform Assembly list
bool IsTpaListProvided();
Expand All @@ -125,7 +123,6 @@ namespace BINDER_SPACE

StringArrayList m_platformResourceRoots;
StringArrayList m_appPaths;
StringArrayList m_appNiPaths;

SimpleNameToFileNameMap * m_pTrustedPlatformAssemblyMap;
};
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/binder/inc/applicationcontext.inl
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ StringArrayList * ApplicationContext::GetPlatformResourceRoots()
return &m_platformResourceRoots;
}

StringArrayList * ApplicationContext::GetAppNiPaths()
{
return &m_appNiPaths;
}

CRITSEC_COOKIE ApplicationContext::GetCriticalSectionCookie()
{
return m_contextCS;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/binder/inc/bindertracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace BinderTracing
enum PathSource
{
ApplicationAssemblies,
AppNativeImagePaths,
Unused,
AppPaths,
PlatformResourceRoots,
SatelliteSubdirectory,
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/binder/inc/defaultassemblybinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class DefaultAssemblyBinder final : public AssemblyLoadContext

HRESULT SetupBindingPaths(SString &sTrustedPlatformAssemblies,
SString &sPlatformResourceRoots,
SString &sAppPaths,
SString &sAppNiPaths);
SString &sAppPaths);

HRESULT Bind(LPCWSTR wszCodeBase,
PEAssembly *pParentAssembly,
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/hosts/corerun/corerun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ static int run(const configuration& config)
pal::ensure_trailing_delimiter(app_path);
}

// Define the NI app_path.
string_t app_path_ni = app_path + W("NI");
pal::ensure_trailing_delimiter(app_path_ni);
app_path_ni.append(1, pal::env_path_delim);
app_path_ni.append(app_path);

// Accumulate path for native search path.
pal::stringstream_t native_search_dirs;
native_search_dirs << app_path << pal::env_path_delim;
Expand Down Expand Up @@ -291,7 +285,6 @@ static int run(const configuration& config)
// Construct CoreCLR properties.
pal::string_utf8_t tpa_list_utf8 = pal::convert_to_utf8(std::move(tpa_list));
pal::string_utf8_t app_path_utf8 = pal::convert_to_utf8(std::move(app_path));
pal::string_utf8_t app_path_ni_utf8 = pal::convert_to_utf8(std::move(app_path_ni));
pal::string_utf8_t native_search_dirs_utf8 = pal::convert_to_utf8(native_search_dirs.str());

std::vector<pal::string_utf8_t> user_defined_keys_utf8;
Expand All @@ -315,11 +308,6 @@ static int run(const configuration& config)
propertyKeys.push_back("APP_PATHS");
propertyValues.push_back(app_path_utf8.c_str());

// APP_NI_PATHS
// - The list of additional paths that the assembly loader will probe for ngen images
propertyKeys.push_back("APP_NI_PATHS");
propertyValues.push_back(app_path_ni_utf8.c_str());

// NATIVE_DLL_SEARCH_DIRECTORIES
// - The list of paths that will be probed for native DLLs called by PInvoke
propertyKeys.push_back("NATIVE_DLL_SEARCH_DIRECTORIES");
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/ClrEtwAll.man
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
</valueMap>
<valueMap name="KnownPathSourceMap">
<map value="0x0" message="$(string.RuntimePublisher.KnownPathSource.ApplicationAssembliesMessage)"/>
<map value="0x1" message="$(string.RuntimePublisher.KnownPathSource.AppNativeImagePathsMessage)"/>
<map value="0x1" message="$(string.RuntimePublisher.KnownPathSource.UnusedMessage)"/>
<map value="0x2" message="$(string.RuntimePublisher.KnownPathSource.AppPathsMessage)"/>
<map value="0x3" message="$(string.RuntimePublisher.KnownPathSource.PlatformResourceRootsMessage)"/>
<map value="0x4" message="$(string.RuntimePublisher.KnownPathSource.SatelliteSubdirectoryMessage)"/>
Expand Down Expand Up @@ -8730,7 +8730,7 @@
<string id="RuntimePublisher.TieredCompilationSettingsFlags.QuickJitMapMessage" value="QuickJit" />
<string id="RuntimePublisher.TieredCompilationSettingsFlags.QuickJitForLoopsMapMessage" value="QuickJitForLoops" />
<string id="RuntimePublisher.KnownPathSource.ApplicationAssembliesMessage" value="ApplicationAssemblies" />
<string id="RuntimePublisher.KnownPathSource.AppNativeImagePathsMessage" value="AppNativeImagePaths" />
<string id="RuntimePublisher.KnownPathSource.UnusedMessage" value="Unused" />
<string id="RuntimePublisher.KnownPathSource.AppPathsMessage" value="AppPaths" />
<string id="RuntimePublisher.KnownPathSource.PlatformResourceRootsMessage" value="PlatformResourceRoots" />
<string id="RuntimePublisher.KnownPathSource.SatelliteSubdirectoryMessage" value="SatelliteSubdirectory" />
Expand Down
10 changes: 1 addition & 9 deletions src/coreclr/vm/corhost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ HRESULT CorHost2::CreateAppDomainWithManager(
LPCWSTR pwzTrustedPlatformAssemblies = NULL;
LPCWSTR pwzPlatformResourceRoots = NULL;
LPCWSTR pwzAppPaths = NULL;
LPCWSTR pwzAppNiPaths = NULL;

for (int i = 0; i < nProperties; i++)
{
Expand All @@ -655,11 +654,6 @@ HRESULT CorHost2::CreateAppDomainWithManager(
pwzAppPaths = pPropertyValues[i];
}
else
if (wcscmp(pPropertyNames[i], W("APP_NI_PATHS")) == 0)
{
pwzAppNiPaths = pPropertyValues[i];
}
else
if (wcscmp(pPropertyNames[i], W("DEFAULT_STACK_SIZE")) == 0)
{
extern void ParseDefaultStackSize(LPCWSTR value);
Expand All @@ -679,15 +673,13 @@ HRESULT CorHost2::CreateAppDomainWithManager(
SString sTrustedPlatformAssemblies(pwzTrustedPlatformAssemblies);
SString sPlatformResourceRoots(pwzPlatformResourceRoots);
SString sAppPaths(pwzAppPaths);
SString sAppNiPaths(pwzAppNiPaths);

DefaultAssemblyBinder *pBinder = pDomain->GetTPABinderContext();
_ASSERTE(pBinder != NULL);
IfFailThrow(pBinder->SetupBindingPaths(
sTrustedPlatformAssemblies,
sPlatformResourceRoots,
sAppPaths,
sAppNiPaths));
sAppPaths));
}

*pAppDomainID=DefaultADID;
Expand Down
3 changes: 0 additions & 3 deletions src/mono/mono/mini/monovm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
static MonoCoreTrustedPlatformAssemblies *trusted_platform_assemblies;
static MonoCoreLookupPaths *native_lib_paths;
static MonoCoreLookupPaths *app_paths;
static MonoCoreLookupPaths *app_ni_paths;
static MonoCoreLookupPaths *platform_resource_roots;

static void
Expand Down Expand Up @@ -163,8 +162,6 @@ parse_properties (int propertyCount, const char **propertyKeys, const char **pro
parse_trusted_platform_assemblies (propertyValues[i]);
} else if (prop_len == 9 && !strncmp (propertyKeys [i], "APP_PATHS", 9)) {
app_paths = parse_lookup_paths (propertyValues [i]);
} else if (prop_len == 12 && !strncmp (propertyKeys [i], "APP_NI_PATHS", 12)) {
app_ni_paths = parse_lookup_paths (propertyValues [i]);
} else if (prop_len == 23 && !strncmp (propertyKeys [i], "PLATFORM_RESOURCE_ROOTS", 23)) {
platform_resource_roots = parse_lookup_paths (propertyValues [i]);
} else if (prop_len == 29 && !strncmp (propertyKeys [i], "NATIVE_DLL_SEARCH_DIRECTORIES", 29)) {
Expand Down
1 change: 0 additions & 1 deletion src/native/corehost/hostpolicy/coreclr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ namespace
_X("PROBING_DIRECTORIES"),
_X("STARTUP_HOOKS"),
_X("APP_PATHS"),
_X("APP_NI_PATHS"),
_X("RUNTIME_IDENTIFIER"),
_X("BUNDLE_PROBE"),
_X("HOSTPOLICY_EMBEDDED"),
Expand Down
1 change: 0 additions & 1 deletion src/native/corehost/hostpolicy/coreclr.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ enum class common_property
ProbingDirectories,
StartUpHooks,
AppPaths,
AppNIPaths,
RuntimeIdentifier,
BundleProbe,
HostPolicyEmbedded,
Expand Down
8 changes: 1 addition & 7 deletions src/native/corehost/hostpolicy/hostpolicy_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a
}
}

// App paths and App NI paths.
// App paths.
// Note: Keep this check outside of the loop above since the _last_ key wins
// and that could indicate the app paths shouldn't be set.
if (set_app_paths)
Expand All @@ -257,12 +257,6 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a
log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::AppPaths));
return StatusCode::LibHostDuplicateProperty;
}

if (!coreclr_properties.add(common_property::AppNIPaths, app_base.c_str()))
{
log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::AppNIPaths));
return StatusCode::LibHostDuplicateProperty;
}
}

// Startup hooks
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Loader/binding/tracing/BinderEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ internal class ProbedPath
public enum PathSource : ushort
{
ApplicationAssemblies,
AppNativeImagePaths,
Unused,
AppPaths,
PlatformResourceRoots,
SatelliteSubdirectory
Expand Down
Loading