Module: wine Branch: master Commit: 0b0dbf6acc81e858bf54ecef6b274a601f934ac5 URL: https://gitlab.winehq.org/wine/wine/-/commit/0b0dbf6acc81e858bf54ecef6b274a6...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Aug 28 13:49:16 2023 +0200
wow64: Implement Wow64ProcessPendingCrossProcessItems().
---
dlls/wow64/syscall.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/wow64.spec | 1 + include/winternl.h | 1 + 3 files changed, 64 insertions(+)
diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index f5a020bac0a..4b13fd9d3cd 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -1262,6 +1262,68 @@ void WINAPI Wow64PassExceptionToGuest( EXCEPTION_POINTERS *ptrs ) }
+/********************************************************************** + * Wow64ProcessPendingCrossProcessItems (wow64.@) + */ +void WINAPI Wow64ProcessPendingCrossProcessItems(void) +{ + CROSS_PROCESS_WORK_LIST *list = (void *)wow64info->CrossProcessWorkList; + CROSS_PROCESS_WORK_ENTRY *entry; + BOOLEAN flush = FALSE; + UINT next; + + if (!list) return; + entry = RtlWow64PopAllCrossProcessWorkFromWorkList( &list->work_list, &flush ); + + if (flush) + { + if (pBTCpuNotifyFlushInstructionCache2) pBTCpuNotifyFlushInstructionCache2( NULL, ~0ull ); + while (entry) + { + next = entry->next; + RtlWow64PushCrossProcessWorkOntoFreeList( &list->free_list, entry ); + entry = CROSS_PROCESS_LIST_ENTRY( &list->work_list, next ); + } + return; + } + + while (entry) + { + switch (entry->id) + { + case CrossProcessPreVirtualAlloc: + /* FIXME */ + break; + case CrossProcessPostVirtualAlloc: + if (!pBTCpuNotifyMemoryAlloc) break; + pBTCpuNotifyMemoryAlloc( (void *)entry->addr, entry->size, entry->args[0], entry->args[1] ); + break; + case CrossProcessPreVirtualFree: + if (!pBTCpuNotifyMemoryFree) break; + pBTCpuNotifyMemoryFree( (void *)entry->addr, entry->size, entry->args[0] ); + break; + case CrossProcessPostVirtualFree: + /* FIXME */ + break; + case CrossProcessPreVirtualProtect: + if (!pBTCpuNotifyMemoryProtect) break; + pBTCpuNotifyMemoryProtect( (void *)entry->addr, entry->size, entry->args[0] ); + break; + case CrossProcessPostVirtualProtect: + /* FIXME */ + break; + case CrossProcessFlushCache: + if (!pBTCpuNotifyFlushInstructionCache2) break; + pBTCpuNotifyFlushInstructionCache2( (void *)entry->addr, entry->size ); + break; + } + next = entry->next; + RtlWow64PushCrossProcessWorkOntoFreeList( &list->free_list, entry ); + entry = CROSS_PROCESS_LIST_ENTRY( &list->work_list, next ); + } +} + + /********************************************************************** * Wow64RaiseException (wow64.@) */ diff --git a/dlls/wow64/wow64.spec b/dlls/wow64/wow64.spec index 1f09e1411bb..760f88ada77 100644 --- a/dlls/wow64/wow64.spec +++ b/dlls/wow64/wow64.spec @@ -16,6 +16,7 @@ @ stdcall Wow64PassExceptionToGuest(ptr) @ stub Wow64PrepareForDebuggerAttach @ stdcall Wow64PrepareForException(ptr ptr) +@ stdcall Wow64ProcessPendingCrossProcessItems() @ stdcall Wow64RaiseException(long ptr) @ stub Wow64ShallowThunkAllocObjectAttributes32TO64_FNC @ stub Wow64ShallowThunkAllocSecurityQualityOfService32TO64_FNC diff --git a/include/winternl.h b/include/winternl.h index 9d92e1cd6ff..bb0eee70ef3 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4167,6 +4167,7 @@ void WINAPI Wow64ApcRoutine(ULONG_PTR,ULONG_PTR,ULONG_PTR,CONTEXT*); NTSTATUS WINAPI Wow64KiUserCallbackDispatcher(ULONG,void*,ULONG,void**,ULONG*); void WINAPI Wow64PassExceptionToGuest(EXCEPTION_POINTERS*); void WINAPI Wow64PrepareForException(EXCEPTION_RECORD*,CONTEXT*); +void WINAPI Wow64ProcessPendingCrossProcessItems(void); NTSTATUS WINAPI Wow64RaiseException(int,EXCEPTION_RECORD*); NTSTATUS WINAPI Wow64SystemServiceEx(UINT,UINT*);