Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

GetSystemInfo to get processor architecture

jaeger0
Beginner
1,853 Views

I used the function GetSystemInfo.

The function retured for wProcessorArchitecture = "IA-32" however the Windows System tells mi I have a 64Bit operating system,

whats going wrong here ?

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,853 Views

My guess is that you built a 32-bit application. If you do that, you should get a value of 10 back, which means IA-32 running under WOW64. If you build the program as a 64-bit application it should return the value for x64.

0 Kudos
jaeger0
Beginner
1,853 Views

My guess is that you built a 32-bit application. If you do that, you should get a value of 10 back, which means IA-32 running under WOW64. If you build the program as a 64-bit application it should return the value for x64.


Ok, thats right, for the moment I build a 32 bit application. My Intension was to ask for the System architecture, not in which my application was build, So is GetSystemInfo the wrong mehtod ?

0 Kudos
Steven_L_Intel1
Employee
1,853 Views

You can distinguish between IA-32 32-bit and IA-32 running under WOW64. See the Platform sample included with Intel Visual Fortran 10.1 for details.

0 Kudos
jaeger0
Beginner
1,853 Views

You can distinguish between IA-32 32-bit and IA-32 running under WOW64. See the Platform sample included with Intel Visual Fortran 10.1 for details.

I looked at the example, and if I compile as a Win32 I get 0 as return, which is IA-32

If I compile as x64, I get Intel or 64 or AMD64* as return

however the system Information tells me I have Intel core2 Quad CPU and a 64Bit operating System. So I'm still wondering, why I get IA-32

0 Kudos
Dmitry_Vyukov
Valued Contributor I
1,853 Views
Quoting - jaeger0

I looked at the example, and if I compile as a Win32 I get 0 as return, which is IA-32

If I compile as x64, I get Intel or 64 or AMD64* as return

however the system Information tells me I have Intel core2 Quad CPU and a 64Bit operating System. So I'm still wondering, why I get IA-32

Try GetNativeSystemInfo().

Retrieves information about the current system to an application running under WOW64. If the function is called from a 64-bit application, it is equivalent to the GetSystemInfo function.

Or you can use GetSystemInfo() and then call IsWow64Process() to determine whether you are running 32-bit application on 64-bit OS.

0 Kudos
jaeger0
Beginner
1,853 Views
Quoting - Dmitriy Vyukov

Try GetNativeSystemInfo().

Retrieves information about the current system to an application running under WOW64. If the function is called from a 64-bit application, it is equivalent to the GetSystemInfo function.

Or you can use GetSystemInfo() and then call IsWow64Process() to determine whether you are running 32-bit application on 64-bit OS.

It seems, that, GetNativeSystemInfo is not implemented im my Kernel32 module, but however

I used IsWow64Process instead, I had to wrap it, or how it is called. But this workes.

Thanks

0 Kudos
Reply