@@ -124,7 +124,7 @@ PEImageLayout* PEImageLayout::Load(PEImage* pOwner, HRESULT* loadFailure)
124
124
{
125
125
if (!pOwner->IsInBundle ()
126
126
#if defined(TARGET_UNIX)
127
- || ( pOwner->GetUncompressedSize () == 0 )
127
+ || ! pOwner->IsCompressed ( )
128
128
#endif
129
129
)
130
130
{
@@ -537,7 +537,7 @@ LoadedImageLayout::LoadedImageLayout(PEImage* pOwner, HRESULT* loadFailure)
537
537
CONTRACTL_END;
538
538
539
539
m_pOwner = pOwner;
540
- _ASSERTE (pOwner->GetUncompressedSize () == 0 );
540
+ _ASSERTE (! pOwner->IsCompressed () );
541
541
542
542
#ifndef TARGET_UNIX
543
543
_ASSERTE (!pOwner->IsInBundle ());
@@ -670,12 +670,13 @@ FlatImageLayout::FlatImageLayout(PEImage* pOwner)
670
670
// It's okay if resource files are length zero
671
671
if (size > 0 )
672
672
{
673
- INT64 uncompressedSize = pOwner->GetUncompressedSize ();
673
+ INT64 uncompressedSize;
674
+ BOOL isCompressed = pOwner->IsCompressed (&uncompressedSize);
674
675
675
676
DWORD mapAccess = PAGE_READONLY;
676
677
#if !defined(TARGET_UNIX)
677
678
// to map sections into executable views on Windows the mapping must have EXECUTE permissions
678
- if (uncompressedSize == 0 )
679
+ if (!isCompressed )
679
680
{
680
681
mapAccess = PAGE_EXECUTE_READ;
681
682
}
@@ -701,7 +702,7 @@ FlatImageLayout::FlatImageLayout(PEImage* pOwner)
701
702
m_FileView.Assign (view);
702
703
addr = (LPVOID)((size_t )view + offset - mapBegin);
703
704
704
- if (uncompressedSize > 0 )
705
+ if (isCompressed )
705
706
{
706
707
#if defined(CORECLR_EMBEDDED)
707
708
// The mapping we have just created refers to the region in the bundle that contains compressed data.
@@ -1031,7 +1032,7 @@ void* FlatImageLayout::LoadImageByMappingParts(SIZE_T* m_imageParts) const
1031
1032
}
1032
1033
CONTRACTL_END;
1033
1034
1034
- if (!HavePlaceholderAPI () || m_pOwner->GetUncompressedSize () != 0 )
1035
+ if (!HavePlaceholderAPI () || m_pOwner->IsCompressed () )
1035
1036
{
1036
1037
return NULL ;
1037
1038
}
0 commit comments