{
pILImage = PEImage::OpenImage(pwzILPath,
MDInternalImport_Default,
- Bundle::ProbeAppBundle(pwzILPath));
+ BundleFileLocation::Invalid());
// Need to verify that this is a valid CLR assembly.
if (!pILImage->CheckILFormat())
{
pNIImage = PEImage::OpenImage(pwzNIPath,
MDInternalImport_TrustedNativeImage,
- Bundle::ProbeAppBundle(pwzNIPath));
+ BundleFileLocation::Invalid());
if (pNIImage->HasReadyToRunHeader())
{
EX_TRY
{
SString path(SString::Literal, pLocator->m_pPath);
- if (PathEquals(path, pImage->GetPath()))
+ BOOL isInBundle = pLocator->m_bIsInBundle;
+ if (PathEquals(path, pImage->GetPath()) &&
+ (!isInBundle == !pImage->IsInBundle()))
ret = TRUE;
}
EX_CATCH_HRESULT(hr); //<TODO>ignores failure!</TODO>
};
static PTR_PEImage FindById(UINT64 uStreamAsmId, DWORD dwModuleId);
- static PTR_PEImage FindByPath(LPCWSTR pPath);
+ static PTR_PEImage FindByPath(LPCWSTR pPath,
+ BOOL isInBundle = TRUE);
static PTR_PEImage FindByShortPath(LPCWSTR pPath);
static PTR_PEImage FindByLongPath(LPCWSTR pPath);
void AddToHashMap();
{
LPCWSTR m_pPath;
+ BOOL m_bIsInBundle;
- PEImageLocator(LPCWSTR pPath)
- : m_pPath(pPath)
+ PEImageLocator(LPCWSTR pPath, BOOL bIsInBundle)
+ : m_pPath(pPath),
+ m_bIsInBundle(bIsInBundle)
{
}
PEImageLocator(PEImage * pImage)
: m_pPath(pImage->m_path.GetUnicode())
{
+ m_bIsInBundle = pImage->IsInBundle();
}
};
/*static*/
-inline PTR_PEImage PEImage::FindByPath(LPCWSTR pPath)
+inline PTR_PEImage PEImage::FindByPath(LPCWSTR pPath, BOOL isInBundle /* = TRUE */)
{
CONTRACTL
{
int CaseHashHelper(const WCHAR *buffer, COUNT_T count);
- PEImageLocator locator(pPath);
+ PEImageLocator locator(pPath, isInBundle);
#ifdef FEATURE_CASE_SENSITIVE_FILESYSTEM
DWORD dwHash=path.Hash();
#else
DWORD dwHash = CaseHashHelper(pPath, (COUNT_T) wcslen(pPath));
#endif
- return (PEImage *) s_Images->LookupValue(dwHash, &locator);
+ return (PEImage *) s_Images->LookupValue(dwHash, &locator);
}
CrstHolder holder(&s_hashLock);
- PEImage* found = FindByPath(pPath);
+ PEImage* found = FindByPath(pPath, bundleFileLocation.IsValid());
if (found == (PEImage*) INVALIDENTRY)
}
CONTRACT_END;
-
#ifdef FEATURE_CASE_SENSITIVE_FILESYSTEM
RETURN m_path.Hash();
#else