From 9d4635d3be8d7cefa77691e8ba0f6cba4939690c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 18 Jun 2024 12:55:41 +0200 Subject: [PATCH] kernelbase: Send cross process notifications in FlushInstructionCache on ARM64. (cherry picked from commit 9c6fb2b30c870e9e50079a0c49426c90353198df) CW-Bug-Id: #23951 --- dlls/kernelbase/memory.c | 16 ++++++++++++++++ dlls/kernelbase/process.c | 9 --------- dlls/ntdll/tests/wow64.c | 1 - 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 2e30ebc9067..faa6bd7d5ee 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -122,6 +122,22 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlushViewOfFile( const void *base, SIZE_T size ) } +/**************************************************************************** + * FlushInstructionCache (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size ) +{ + CROSS_PROCESS_WORK_LIST *list; + + if ((list = open_cross_process_connection( process ))) + { + send_cross_process_notification( list, CrossProcessFlushCache, addr, size, 0 ); + close_cross_process_connection( list ); + } + return set_ntstatus( NtFlushInstructionCache( process, addr, size )); +} + + /*********************************************************************** * GetLargePageMinimum (kernelbase.@) */ diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 0898e30f603..3bfce035b5f 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -940,15 +940,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH DuplicateHandle( HANDLE source_process, HANDLE sou } -/**************************************************************************** - * FlushInstructionCache (kernelbase.@) - */ -BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size ) -{ - return set_ntstatus( NtFlushInstructionCache( process, addr, size )); -} - - /*********************************************************************** * GetApplicationRestartSettings (kernelbase.@) */ diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 3936d5a8400..5c9a4d8d57a 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -547,7 +547,6 @@ static void test_cross_process_notifications( HANDLE process, void *ptr ) FlushInstructionCache( process, addr, 0x1234 ); entry = pop_from_work_list( &list->work_list ); - todo_wine_if (current_machine == IMAGE_FILE_MACHINE_ARM64) entry = expect_cross_work_entry( list, entry, CrossProcessFlushCache, addr, 0x1234, 0xcccccccc, 0xcccccccc, 0xcccccccc, 0xcccccccc ); ok( !entry, "not at end of list\n" );