[PATCH 3/3] dbghelp: fix failing SymInitialize for a live 32bit target from a 64bit caller in WOW64

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Aug 31 08:49:54 CDT 2021


On 31/08/2021 12:53, Alexandre Julliard wrote:
> Eric Pouech <eric.pouech at gmail.com> writes:
> 
>> When:
>> - caller of dbghelp is a 64bit process,
>> - invoking SymInitialize on a 32bit live target running under WOW64
>>
>> SymInitialize fails because:
>> - check_live_target() erroneously reads the 64bit PEB of the target,
>>    while it actually wants the 32bit PEB.
>> - as the ELF base header address isn't set (hidden in CloudFileFlags)
>>    in the 64bit PEB, hence causing the failure
>>
>> So ensure that check_live_target() actually reads the 32bit PEB when
>> handling a 32bit process.
>>
>>
>> ----
>>
>> I couldn't find a simpler way to fix it :-(
>> (offsetting PEB address by 0x1000 works but is way too hacky)
> 
> Offsetting by 0x1000 is fine.
> 
> But I'd say that the ELF data should be stored in the 64-bit PEB. Also
> note that once the new Wow64 architecture is enabled, all ELF data
> inside 32-bit processes is going to be 64-bit.
> 

Sorry for the off topic remark, but is there some brief documentation on 
how this is going to work posted anywhere? Will it be optional? (i.e. if 
the host supplies 32-bit libs, wine will still use them).

I'm mainly concerned about it adding too much overhead, mostly for stuff 
that relies on heavy library usage for performance (probably graphics 
API related, like 32-bit games)... But maybe I misunderstand the whole 
thing.



More information about the wine-devel mailing list