Commit cc0ca49a authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Pass the WoW context to the server on ARM64.

parent fa47ea74
...@@ -590,7 +590,7 @@ void *get_native_context( CONTEXT *context ) ...@@ -590,7 +590,7 @@ void *get_native_context( CONTEXT *context )
*/ */
void *get_wow_context( CONTEXT *context ) void *get_wow_context( CONTEXT *context )
{ {
return NULL; return get_cpu_area( main_image_info.Machine );
} }
...@@ -878,6 +878,15 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size ) ...@@ -878,6 +878,15 @@ NTSTATUS get_thread_wow64_context( HANDLE handle, void *ctx, ULONG size )
memcpy( &context->FloatSave, &wow_frame->FloatSave, sizeof(context->FloatSave) ); memcpy( &context->FloatSave, &wow_frame->FloatSave, sizeof(context->FloatSave) );
context->ContextFlags |= CONTEXT_I386_FLOATING_POINT; context->ContextFlags |= CONTEXT_I386_FLOATING_POINT;
} }
if (needed_flags & CONTEXT_I386_DEBUG_REGISTERS)
{
context->Dr0 = wow_frame->Dr0;
context->Dr1 = wow_frame->Dr1;
context->Dr2 = wow_frame->Dr2;
context->Dr3 = wow_frame->Dr3;
context->Dr6 = wow_frame->Dr6;
context->Dr7 = wow_frame->Dr7;
}
/* FIXME: CONTEXT_I386_XSTATE */ /* FIXME: CONTEXT_I386_XSTATE */
break; break;
} }
......
...@@ -214,8 +214,15 @@ static unsigned int get_server_context_flags( const void *context, USHORT machin ...@@ -214,8 +214,15 @@ static unsigned int get_server_context_flags( const void *context, USHORT machin
*/ */
static unsigned int get_native_context_flags( USHORT native_machine, USHORT wow_machine ) static unsigned int get_native_context_flags( USHORT native_machine, USHORT wow_machine )
{ {
if (native_machine == wow_machine) return 0; switch (MAKELONG( native_machine, wow_machine ))
return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT | SERVER_CTX_YMM_REGISTERS; {
case MAKELONG( IMAGE_FILE_MACHINE_AMD64, IMAGE_FILE_MACHINE_I386 ):
return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT | SERVER_CTX_YMM_REGISTERS;
case MAKELONG( IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_ARMNT ):
return SERVER_CTX_DEBUG_REGISTERS | SERVER_CTX_FLOATING_POINT;
default:
return 0;
}
} }
...@@ -595,6 +602,10 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void ...@@ -595,6 +602,10 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
case MAKELONG( IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_I386 ):
case MAKELONG( IMAGE_FILE_MACHINE_I386, IMAGE_FILE_MACHINE_ARM64 ):
return STATUS_SUCCESS;
default: default:
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
} }
...@@ -974,7 +985,6 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma ...@@ -974,7 +985,6 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
ARM64_NT_CONTEXT *to = dst; ARM64_NT_CONTEXT *to = dst;
to_flags = to->ContextFlags & ~CONTEXT_ARM64; to_flags = to->ContextFlags & ~CONTEXT_ARM64;
to->ContextFlags = CONTEXT_ARM64;
if ((from->flags & SERVER_CTX_CONTROL) && (to_flags & CONTEXT_ARM64_CONTROL)) if ((from->flags & SERVER_CTX_CONTROL) && (to_flags & CONTEXT_ARM64_CONTROL))
{ {
to->ContextFlags |= CONTEXT_ARM64_CONTROL; to->ContextFlags |= CONTEXT_ARM64_CONTROL;
...@@ -1011,6 +1021,10 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma ...@@ -1011,6 +1021,10 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
case MAKELONG( IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_I386 ):
case MAKELONG( IMAGE_FILE_MACHINE_I386, IMAGE_FILE_MACHINE_ARM64 ):
return STATUS_SUCCESS;
default: default:
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment