Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.33 KB

File metadata and controls

51 lines (31 loc) · 1.33 KB

Home

How to check whether the system is 32-bit or 64-bit

Before you begin:

The IsWow64Process function determines whether the specified process is running under WOW64.


Code:

DO declare

LOCAL nHandle, lWow64Process

nHandle = GetCurrentProcess()
lWow64Process = 0

IsWow64Process(nHandle, @lWow64Process)

CloseHandle(nHandle)

? IIF(lWow64Process = 0, "32-bit", "64-bit")
* end of main

PROCEDURE declare
	DECLARE INTEGER GetCurrentProcess IN kernel32
	
	DECLARE INTEGER CloseHandle IN kernel32 INTEGER hObject	
	
	DECLARE INTEGER IsWow64Process IN kernel32;
		INTEGER hProcess, INTEGER @Wow64Process  

Listed functions:

CloseHandle
GetCurrentProcess
IsWow64Process

Comment:

Note that the minimum supported client:is Windows XP with SP2.

By calling API functions LoadLibrary and GetProcAddress it is possible to determine whether the IsWow64Process is included in the present Kernel32.dll library.

In .NET Framework 4 and on, use Environment.Is64BitOperatingSystem.