Thursday, October 14, 2010

How to know Windows platform support

Tip – How to know Windows platform support
 
Details – Using GetSystemInfo and GetNativeSystemInfo API

GetSystemInfo – This API can return the system information including the platform support.
GetNativeSystemInfo – If 32 bit application is running in 64 bit operating system (WOW64), the GetSystemInfo API returns the platform as 32bit. If the (32-bit) application is particular about getting the true underlying platform, we can use this API. (e.g. If we run ProcessExplorer in 64 bit Windows, the basic itself extract another EXE to take the full advantage of 64-bit OS. The original Process Explorer is 32 bit process. In this kind of situations, we can use GetNativeSystemInfo. Generally we may have to GetSystemInfo only.
Using pointer size

if(sizeof(void*) == 4 )
// 32 bit
else(sizeof(void*) == 8 )
// 64 bit
(This method is not advised. Better using the API itself)


Reference
http://codereflect.com/2010/10/09/getting-processor-architecture-in-x86-and-x64-bit-platform/
http://msdn.microsoft.com/en-us/library/ms724340(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms724381(VS.85).aspx

Posted by - Sarath C

No comments:

Post a Comment