View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Wed Nov 24, 2010 1:12 pm Post subject: Recognition of 64 bit system |
|
|
How can I apply IsWow64Process in my Fortran program?
Erwin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Nov 25, 2010 9:49 am Post subject: |
|
|
The function takes the form
Code: | BOOL WINAPI IsWow64Process(
__in HANDLE hProcess,
__out PBOOL Wow64Process
);
|
It resides in kernel32.dll which I guess SLINK will access automatically.
You will be able to see similar functions in win32api.ins. I am guessing that the interface will be something like
STDCALL IsWow64Process 'IsWow64Process'(VAL,REF):LOGICAL*4
You will also need to get hold of the handle of the current process.... |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Thu Nov 25, 2010 1:10 pm Post subject: |
|
|
Paul,
See the Microsoft article
http://msdn.microsoft.com/en-us/library/ms684139
which states:
"For compatibility with operating systems that do not support this function, call GetProcAddress to detect whether IsWow64Process is implemented in Kernel32.dll. If GetProcAddress succeeds, it is safe to call this function. Otherwise, WOW64 is not present. Note that this technique is not a reliable way to detect whether the operating system is a 64-bit version of Windows because the Kernel32.dll in current versions of 32-bit Windows also contains this function."
and give some code in a strange language thet you could no doubt translate.
Ian |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Nov 25, 2010 7:06 pm Post subject: |
|
|
You will need Windows XP with SP2 or a later operating system.
If you cannot guarantee this then you will need to call GetProcAddress as you say because the function may not be in the dll. |
|
Back to top |
|
|
|