-
Aug 31st, 2021, 10:49 PM
#1
Thread Starter
PowerPoster
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
-
Sep 1st, 2021, 04:40 AM
#2
Re: Check if it is a 64-bit operating system
Last edited by yereverluvinuncleber; Sep 1st, 2021 at 08:20 AM.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|