Results 1 to 2 of 2

Thread: Check if it is a 64-bit operating system

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2020
    Posts
    1,621

    Check if it is a 64-bit operating system

    Code:
    Private Declare Function GetModuleHandle Lib _
            "kernel32" Alias "GetModuleHandleA" ( _
            ByVal lpModuleName As String) As Long
    Private Declare Function LoadLibrary Lib _
            "kernel32" Alias "LoadLibraryA" ( _
            ByVal lpLibFileName As String) As Long
    Private Declare Function GetProcAddress Lib _
            "kernel32" (ByVal hModule As Long, _
            ByVal lpProcName As String) As Long
    Private Declare Function FreeLibrary Lib _
         "kernel32" (ByVal hLibModule As Long) As Long
    
    Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
    Private Declare Function IsWow64Process Lib "kernel32" (ByVal hProcess As Long, ByRef Wow64Process As Long) As Long
    
    Function IsX64b() As Boolean
            Dim hMod As Long
            hMod = GetModuleHandle("ntdll.dll")
            If GetProcAddress(hMod, "ZwWow64ReadVirtualMemory64") Then
               IsX64b = True
            End If
     End Function
     
     Function IsX64() As Boolean
            Dim lngReturn As Long
            'GetCurrentProcess
            Call IsWow64Process(-1, lngReturn)
            IsX64 = lngReturn <> 0
     End Function

  2. #2
    Frenzied Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,127

    Re: Check if it is a 64-bit operating system

    >redacted<
    Last edited by yereverluvinuncleber; Sep 1st, 2021 at 08:20 AM.
    By the power invested in me, all the threads I start are Niya and Olaf free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width