On 5/15/16 1:00 AM, dandl wrote:
>>> But I think if you compile code for the x64 processor chip and call it
>>> from x86 or vice versa then either it doesn't work or you pay a high
>>> price for thunking from one to the other. I think that's unavoidable
>>> regardless of OS.
>> Right: doesn't work.  There's no performance penalty because there's no
>> 32-64 bit thunking layer.
>>
>>      https://blogs.msdn.microsoft.com/oldnewthing/20081020-00/?p=20523
> An interesting post, but not I think from someone with a deep understanding
> of the matter.
>
> IMHO it would be perfectly possible to chunk either way, within the
> limitations of a 4GB address space. The WOW64 layer already provides the
> means for x86 apps to call the x64 Windows API. A thunk can do anything,
> unless it's physically impossible or blocked by policy.
>
> Regards
> David M Bennett FACS
>
> Andl - A New Database Language - andl.org
>
You can thunk an arbitrary 32 bit module to 64 bit code because the 
memory accessibly by the 32 bit code is all accessible by the 64 bit 
code. The converse doesn't work. Either the 64 bit code needs to make 
sure it puts the data in the lower 4GB, or the thunk layer needs to know 
enough about the data to copy it.

This works for WOW64, as the 64 bit side is code designed to make it 
work with the thunking layer.

For arbitrary 64 bit code, the thunking layer won't know enough about 
what needs to be copied into accessible memory.

-- 
Richard Damon

Reply via email to