[PATCH 2/2] ntdll: Report SegDs to be identical to SegSs in x86_64 exception handlers.

Zebediah Figura (she/her) zfigura at codeweavers.com
Fri Mar 26 10:59:04 CDT 2021


On 3/26/21 6:19 AM, Alexandre Julliard wrote:
> Zebediah Figura <z.figura12 at gmail.com> writes:
> 
>> @@ -1500,11 +1500,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
>>       context->SegFs  = FS_sig(sigcontext);
>>       context->SegGs  = GS_sig(sigcontext);
>>       context->EFlags = EFL_sig(sigcontext);
>> -#ifdef DS_sig
>> -    context->SegDs  = DS_sig(sigcontext);
>> -#else
>> -    __asm__("movw %%ds,%0" : "=m" (context->SegDs));
>> -#endif
>>   #ifdef ES_sig
>>       context->SegEs  = ES_sig(sigcontext);
>>   #else
>> @@ -1515,6 +1510,9 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
>>   #else
>>       __asm__("movw %%ss,%0" : "=m" (context->SegSs));
>>   #endif
>> +   /* Legends of Runeterra depends on having SegDs == SegSs in an exception
>> +    * handler. */
>> +    context->SegDs  = context->SegSs;
> 
> Is there a reason you are not fixing %es too while you are at it?
> 

The application doesn't care about %es, and I wanted to make the patch 
as uninvasive as possible. A proper fix could mean quite a lot of 
changes (some riskier than others), and it isn't clear to me where a 
line can reasonably be drawn.



More information about the wine-devel mailing list