A quick way to check if it is a 32 or 64-bit OS is to determine the size of a pointer. In 32-bit Operating System (OS), the size of the pointer is 4-byte (a DWORD), however at 64-bit OS, the size of the pointer is 8-byte (a QWORD).
Therefore the following Pascal code may be enough.
function Is32: boolean; inline; begin Result := SizeOf(Pointer) = 4; end; function Is64: boolean; inline; begin Result := SizeOf(Pointer) = 8; end;
However, the functions are determined at compiling stage. Thus if you compile the code under Win32, it will return true either under Win32 or Win64 (WOW64). The above functions, in this sense, can be used to check current program is 32-bit or 64-bit, to be more precisely.
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
165 wordsloading...
Last Post: Script32: A Freeware to Convert VBScript/JScript/HTA to Executables
Next Post: Tricks of VBScript
This does not determine the OS architecture, this checks executable compilation architecture.