"David Williams" <DavidWilliams@discussions.microsoft.com> a écrit dans le
message de news:B0C615CE-759E-42C3-8763-10104B10A723@microsoft.com...
[quoted text, click to view] > The little bit that I have tested on this shows the following:
>
> 1) It will only run in the 64Bit mode if you set the platform to 64bit
(which changes a compiler switch - I belive.)
>
> 2) When a call is made to code that was compiled as 32bit (either because
the platform was not set to 64bit or it is COM) WOW64 kicks in - for the new
(newly loaded) assembly.
[quoted text, click to view] >
Not sure this is right. From reading Joshua's blog and from my own
experience it seems that:
1) It will run in 64 bit mode if you set the platform switch to IA64 (on
Itanium), x64 (AMD 64, IA32e) or MSIL. If will run in the WOW64 if the
platform switch was x86
2) If the process is started in 64 bit mode and if you try to load a 32-bit
only DLL (managed or non managed), you will get a BadImageFormatException.
The process will not switch magically to WOW64 at the time of the call
(would be really hard), you have to mark it as 32-bit only (with the
platform compiler switch) so that it starts in the WOW64.
Note: If the 32-bit DLL is loaded statically (listed in the dependencies of
your EXE), VS 2005 should be smart enough to detect this and should compile
your EXE with the x86 platform flag, but this is only a guess, I have not
tested it. If your DLL is loaded dynamically, VS 2005 won't be able to guess
and you have to mark your EXE explicitly as x86.
Bruno.
[quoted text, click to view] > HTH
> --
> David Williams, VB.NET MVP
>
>
> "andrew lowe" wrote:
>
> > Hi,
> >
> > Lets say I have a verifiable assembly which does not use P/Invoke or
> > COM-Interop. On a 64bit OS this will run in the 64bit .net runtime
because i
> > assume the OS loader looks and determines its PE32+. If this assembly
(via a
> > plugin type of framework) loads another assembly that is not verifiable
and
> > performs COM interop or unsafe code, how does the 64bit .net runtime
execute
> > the code ? Does it just run it in WOW64 or revert back to the 32bit
runtime
> > ??
> >
> > tia
> > andrew
> >
> >
> >