- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there is way for Intel fortran to tell if it's running on 32 or 64bits ? The length of an intptr will tell you in the VS CRF but it don't know how to do it in fortran.
Renee
Renee
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]program iswow64 use iso_c_binding use ifwin implicit none type(c_funptr) cfp procedure(IsWow64Process),pointer :: fp integer(4) result cfp = GetProcAddress(GetModuleHandle("kernel32"//achar(0)),"IsWow64Process"//achar(0)) if(c_associated(cfp)) then call c_f_procpointer(cfp,fp) if(fp(GetCurrentProcess(),result) /= 0) then if(result /= 0) then write(*,'(a)') 'It''s a SysWOW64 Process' else write(*,'(a)') 'It''s a normal process' end if else write(*,'(a,i0)') 'Strange error ',GetLastError() end if else write(*,'(a)') 'It''s a 32-bit OS' end if end program iswow64 [/bash]
Link Copied
- « Previous
-
- 1
- 2
- Next »
23 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert,
Actually, I tried that and found that while there was indeed a possible return value for running under WOW, I could not get it to return that value.
Actually, I tried that and found that while there was indeed a possible return value for running under WOW, I could not get it to return that value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve,
I am a little confused now. Some years ago I madesoftware that used the GetSystemInfo function to get relevant system information. There I added the line:
INTEGER,PARAMETER :: PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10
So I did this because I thought at that time that that was relevant. I cannot reconstruct now why I did that and where I found this information.
At present I cannot find any related information on the MSDN network. Search with google gave many hits but I do not see any link with the SYSTEM_INFO structure.Therefore, for the time being I cannot other that conclude that I made a mistake that time!
Thank you that you brought this to my attention.
Robert
I am a little confused now. Some years ago I madesoftware that used the GetSystemInfo function to get relevant system information. There I added the line:
INTEGER,PARAMETER :: PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 = 10
So I did this because I thought at that time that that was relevant. I cannot reconstruct now why I did that and where I found this information.
At present I cannot find any related information on the MSDN network. Search with google gave many hits but I do not see any link with the SYSTEM_INFO structure.Therefore, for the time being I cannot other that conclude that I made a mistake that time!
Thank you that you brought this to my attention.
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The SYSTEM_INFO structure is real - you can find it here - but that value, which is defined in WinNT.h, is not documented. I even included my own definition of it in the Platform sample that calls GetSystemInfo, but I guess it never gets returned.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »