| 194 | } |
| 195 | |
| 196 | void PatchCallChecker() { |
| 197 | // See the comment for CheckCall in Module.S for why this is necessary |
| 198 | const auto Module = reinterpret_cast<HMODULE>(&__ImageBase); |
| 199 | ULONG Size; |
| 200 | const auto* LoadConfig = |
| 201 | reinterpret_cast<_IMAGE_LOAD_CONFIG_DIRECTORY64*>(RtlImageDirectoryEntryToData(Module, true, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &Size)); |
| 202 | const auto* CHPEMetadata = reinterpret_cast<IMAGE_ARM64EC_METADATA*>(LoadConfig->CHPEMetadataPointer); |
| 203 | WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_call, &CheckCall); |
| 204 | WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_icall, &CheckCall); |
| 205 | WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_icall_cfg, &CheckCall); |
| 206 | } |
| 207 | |
| 208 | // Fills in the syscall numbers necessary to call *Native variants of syscalls from FEX under wine. |
| 209 | void ParseWineSyscallNumbers(HMODULE NtDll) { |
no test coverage detected