wow64: Implement Wow64ProcessPendingCrossProcessItems().

This commit is contained in:
Alexandre Julliard 2023-08-28 13:49:16 +02:00
parent f6dbcccab9
commit 0b0dbf6acc
3 changed files with 64 additions and 0 deletions

View file

@ -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.@)
*/

View file

@ -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

View file

@ -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*);