2013年6月18日 星期二

Procedure.i sgl_Is64BitOS()



Procedure.i sgl_Is64BitOS()
; [DESC]
; Check if the OS under which the program is running is a 64 bit OS.
;
; [RETURN]
; 1 for 64 bit OS, else 0.
 Protected Is64BitOS = 0
 Protected hDLL, IsWow64Process_

 If SizeOf(Integer) = 8
    Is64BitOS = 1 ; this is a 64 bit exe
 Else
    hDll = OpenLibrary(#PB_Any,"kernel32.dll")
    ;m_ASSERT(hDLL)
    If hDll
        IsWow64Process_ = GetFunction(hDll,"IsWow64Process")
        If IsWow64Process_
            CallFunctionFast(IsWow64Process_, GetCurrentProcess_(), @Is64BitOS)
        EndIf
        CloseLibrary(hDll)
    EndIf    
 EndIf

 ProcedureReturn Is64BitOS
EndProcedure

沒有留言:

張貼留言