diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-11-16 17:19:43 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-11-16 17:19:43 +0300 |
commit | 756ace58c91fc9e9da5de694692db41ce09d23e9 (patch) | |
tree | b9fae5bd4a07624e70acbcc8ddf0a2d6c7f10ec2 /src/Native/Runtime/MiscHelpers.cpp | |
parent | 5b3e51d3a93facb9be41f3274d2f3a175899d9a5 (diff) |
Add back full StartupCodeHelpers.cs to ProjectN build
Some flavors depend on InitializeModules
[tfs-changeset: 1681285]
Diffstat (limited to 'src/Native/Runtime/MiscHelpers.cpp')
-rw-r--r-- | src/Native/Runtime/MiscHelpers.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/Native/Runtime/MiscHelpers.cpp b/src/Native/Runtime/MiscHelpers.cpp index e78b2baf3..206ca0a03 100644 --- a/src/Native/Runtime/MiscHelpers.cpp +++ b/src/Native/Runtime/MiscHelpers.cpp @@ -158,7 +158,7 @@ COOP_PINVOKE_HELPER(HANDLE, RhGetOSModuleFromEEType, (EEType * pEEType)) // We should never get here (an EEType not located in any module) so fail fast to indicate the bug. RhFailFast(); - return NULL; + return NULL; } #endif // PROJECTN @@ -201,25 +201,8 @@ COOP_PINVOKE_HELPER(Boolean, RhFindBlob, (TypeManagerHandle *pTypeManagerHandle, { TypeManagerHandle typeManagerHandle = *pTypeManagerHandle; - if (typeManagerHandle.IsTypeManager()) - { - ReadyToRunSectionType section = - (ReadyToRunSectionType)((UInt32)ReadyToRunSectionType::ReadonlyBlobRegionStart + blobId); - ASSERT(section <= ReadyToRunSectionType::ReadonlyBlobRegionEnd); - - TypeManager* pModule = typeManagerHandle.AsTypeManager(); - - int length; - void* pBlob; - pBlob = pModule->GetModuleSection(section, &length); - - *ppbBlob = (UInt8*)pBlob; - *pcbBlob = (UInt32)length; - - return pBlob != NULL; - } -#if PROJECTN - else +#ifdef PROJECTN + if (!typeManagerHandle.IsTypeManager()) { HANDLE hOsModule = typeManagerHandle.AsOsModule(); // Search for the Redhawk module contained by the OS module. @@ -256,14 +239,28 @@ COOP_PINVOKE_HELPER(Boolean, RhFindBlob, (TypeManagerHandle *pTypeManagerHandle, } } END_FOREACH_MODULE + + // If we get here we were passed a bad module handle and should fail fast since this indicates a nasty bug + // (which could lead to the wrong blob being returned in some cases). + RhFailFast(); + return FALSE; } #endif // PROJECTN - // If we get here we were passed a bad module handle and should fail fast since this indicates a nasty bug - // (which could lead to the wrong blob being returned in some cases). - RhFailFast(); + ReadyToRunSectionType section = + (ReadyToRunSectionType)((UInt32)ReadyToRunSectionType::ReadonlyBlobRegionStart + blobId); + ASSERT(section <= ReadyToRunSectionType::ReadonlyBlobRegionEnd); + + TypeManager* pModule = typeManagerHandle.AsTypeManager(); + + int length; + void* pBlob; + pBlob = pModule->GetModuleSection(section, &length); + + *ppbBlob = (UInt8*)pBlob; + *pcbBlob = (UInt32)length; - return FALSE; + return pBlob != NULL; } // This helper is not called directly but is used by the implementation of RhpCheckCctor to locate the |