"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."
This means that "IsWow64Process" alone cannot differentiate between a 32bit process on 32bit Windows and a 64bit process on 64bit Windows because 'IsWow64Process' returns false for both conditions. However, it does not mean that "IsWow64Process" can't be used to determine the actual OS bit'ness (not the process bit'ness) and it just needs a little help.
So, I can't get to a 64 bit windows system right now and if someone could check this on 64 bit windows it would help as I wanted to check this in PB.
Code: Select all
; based upon the code at:
; http://1code.codeplex.com/SourceControl/changeset/view/39074#842774
; http://1code.codeplex.com/SourceControl/changeset/view/39074#842775
; both samples written by Jialiang Ge, MSFT, I believe
Prototype PIsWow64Process(hProcess, out_Wow64Process)
Global IsWow64Process.PIsWow64Process
Lib_Kernel32 = OpenLibrary(#PB_Any,"Kernel32.dll")
If IsLibrary(Lib_Kernel32)
IsWow64Process.PIsWow64Process=GetFunction(Lib_Kernel32,"IsWow64Process")
EndIf
; This procedure returns true if the operating system its self, not the process, is 64-bit otherwise it returns false.
; for Windows Vista (and WinXP Pro 64bit with SP2) and above - tested so far on Windows 7 x86 - PB 4.60
Procedure.b Is64BitOS()
If SizeOf(Integer) = 8 ; if int = 8 then 64 bit - 64 bit programs run only on Win 64 and if 64 bit program is running clearly its 64 bit OS
ProcedureReturn #True ;;;; 64 bit programs run only on Win64
Else ; 32 bit processes can run on 64 bit windows so what if its a 32 bit process running in 64 bit windows and we still need to determine the OS bit'ness
; this checks for that and returns #False is the OS its self is 32 bit, #True if OS its self is 64 bit
f64bitOS.b = #False
ProcedureReturn ((IsWow64Process(GetCurrentProcess_(), @f64bitOS)) And f64bitOS)
EndIf
EndProcedure
Debug Is64BitOS()
Anyway, if someone could check it that would be great, Thanks


