Click here to Skip to main content
Licence CPOL
First Posted 12 Oct 2010
Views 5,177
Bookmarked 3 times

Getting Processor architecture in x86 and x64 bit platforms

By | 12 Oct 2010 | Technical Blog
Getting Processor architecture in x86 and x64 bit platforms
A Technical Blog article. View original blog here.[^]

GetSystemInfo provides the basic system information and processor architecture of the underlying platform. This API can be used successfully in both x64 and x86 platforms. But, under 64-bit WIndows, we can run 32 bit Applications( WOW64). If a WOW64 process calls GetSystemInfo API, it will return the processor architecture as x86. Of course, it should be the way. If this API acts otherwise, there could be compatibility problems that may arise and the application could act weird and show undefined behavior.

If the WOW64 process wants to know the original platform it’s running, it must call GetNativeSystemInfo. When do we have to use this? I've a real world example. When we spawn process explorer (procexp.exe, it realizes the underlying platform and creates another EXE procexp64.exe (64bit version) to iterate all process information in the system. Note that the GetNativeSystemInfo needs to be called only if your 32bit application wants to run under 64 bit platform and needs to care about the true underlying platform. In all other cases, call GetSystemInfo, which works across platforms uniquely. See the snippet below:

To know more about the different processor architectures at the abstract level, please do check one of my previous posts.


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sarath.

Technical Lead
NeST
India India

Member

My Name is Sarath. I'm working for Network System Technologies Pvt. Ltd (NeST).

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 12 Oct 2010
Article Copyright 2010 by Sarath.
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid