Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Install unwind handlers if present
  • Loading branch information
VSadov committed Aug 3, 2020
commit af3da0d012c7b398e7a4e243daf2a5394a4caa55
13 changes: 13 additions & 0 deletions src/coreclr/src/vm/peimagelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,19 @@ ConvertedImageLayout::ConvertedImageLayout(PEImageLayout* source)
ThrowHR(COR_E_BADIMAGEFORMAT);

ApplyBaseRelocations();

// Check if there is a static function table.
COUNT_T cbSize = 0;
PT_RUNTIME_FUNCTION pExceptionDir = (PT_RUNTIME_FUNCTION)GetDirectoryEntryData(IMAGE_DIRECTORY_ENTRY_EXCEPTION, &cbSize);
DWORD tableSize = cbSize / sizeof(T_RUNTIME_FUNCTION);

if (pExceptionDir != NULL)
{
if (!RtlAddFunctionTable(pExceptionDir, tableSize, (DWORD64)this->GetBase()))
ThrowLastError();

//TODO: WIP remember tbl to undo the above when releasing img
}
}
#endif
}
Expand Down