Fix resource loading (dotnet/coreclr#23714)
authorDavid Wrighton <davidwr@microsoft.com>
Thu, 4 Apr 2019 02:11:00 +0000 (19:11 -0700)
committerGitHub <noreply@github.com>
Thu, 4 Apr 2019 02:11:00 +0000 (19:11 -0700)
- Some resources are generated without setting a Major/Minor version in the resource directory
- This is legal, and we shouldn't skip parsing the resource

Commit migrated from https://github.com/dotnet/coreclr/commit/046d9d4fe9206396fac4a9e0c7b7c8b5801947b3

src/coreclr/src/utilcode/pedecoder.cpp

index 7324f6e..c0d0d61 100644 (file)
@@ -1801,12 +1801,6 @@ DWORD PEDecoder::ReadResourceDictionary(DWORD rvaOfResourceSection, DWORD rva, L
 
     IMAGE_RESOURCE_DIRECTORY *pResourceDirectory = (IMAGE_RESOURCE_DIRECTORY *)GetRvaData(rva);
 
-    if (pResourceDirectory->MajorVersion != 4)
-        return 0;
-
-    if (pResourceDirectory->MinorVersion != 0)
-        return 0;
-
     // Check to see if entire resource dictionary is accessible
     if (!CheckRva(rva + sizeof(IMAGE_RESOURCE_DIRECTORY), 
                        (sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) * pResourceDirectory->NumberOfNamedEntries) +