Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / July 2004

Tip: Looking for answers? Try searching our database.

64Bit .Net & WOW64

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andrew lowe - 08 Jul 2004 08:14 GMT
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
David Williams - 08 Jul 2004 19:10 GMT
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.

HTH
Signature

David Williams, VB.NET MVP

> Hi,
>
[quoted text clipped - 8 lines]
> tia
> andrew
Joshua Williams - 09 Jul 2004 06:16 GMT
I wrote a blog entry on this topic, you can find it at:
http://blogs.msdn.com/joshwil/archive/2004/03/11/88280.aspx

-josh [MS]

> The little bit that I have tested on this shows the following:
>
[quoted text clipped - 16 lines]
> > tia
> > andrew
Bruno Jouhier [MVP] - 10 Jul 2004 12:40 GMT
> 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.

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.

> HTH
>
[quoted text clipped - 10 lines]
> > tia
> > andrew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.