From: Daniel Lu <daniel@lawrence.lu> NtMapViewOfSection currently notifies the ARM64EC runtime about image mappings through NotifyMapViewOfSection, but non-image section mappings return before any notification is sent. Those mappings can still create executable views and can replace a previously tracked executable range. Report them through the existing memory-protection notification callback so the ARM64EC runtime sees the final mapped protection. --- dlls/ntdll/signal_arm64ec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index c0bfab1157e..4af3cca2d85 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -725,9 +725,17 @@ static void notify_map_view_of_section( HANDLE handle, void *addr, SIZE_T size, SECTION_IMAGE_INFORMATION info; NTSTATUS status; + if (NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL )) + { + if (pNotifyMemoryProtect) + { + pNotifyMemoryProtect( addr, size, protect, FALSE, 0 ); + pNotifyMemoryProtect( addr, size, protect, TRUE, STATUS_SUCCESS ); + } + return; + } if (!pNotifyMapViewOfSection) return; if (!NtCurrentTeb()->Tib.ArbitraryUserPointer) return; - if (NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL )) return; status = pNotifyMapViewOfSection( NULL, addr, NULL, size, alloc, protect ); if (NT_SUCCESS(status)) return; NtUnmapViewOfSection( GetCurrentProcess(), addr ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10985