PROCESS-ARCHITECTURE
|
DEFINE VARIABLE hProcess AS INTEGER NO-UNDO.
DEFINE VARIABLE Wow64Process AS INTEGER NO-UNDO. DEFINE VARIABLE resultValue AS INTEGER NO-UNDO. IF PROCESS-ARCHITECTURE = 64 THEN /* 64-bit processes always run on 64-bit Windows */ MESSAGE "64-bit process running on 64-bit Windows". ELSE DO: /* If a 32-bit process is running under WOW64 it must be ** running on 64-bit Windows. Otherwise, it is running on ** 32-bit Windows. */ RUN GetCurrentProcess(OUTPUT hProcess). RUN IsWow64Process(hProcess, INPUT-OUTPUT Wow64Process, OUTPUT resultValue). MESSAGE "32-bit process running on " + (IF Wow64Process > 0 THEN "64" ELSE "32") + "-bit Windows". END. PROCEDURE GetCurrentProcess EXTERNAL "kernel32.dll": DEFINE RETURN PARAMETER hProcess AS LONG. END. PROCEDURE IsWow64Process EXTERNAL "kernel32.dll": DEFINE INPUT PARAMETER hProcess AS LONG. DEFINE INPUT-OUTPUT PARAMETER Wow64Process AS HANDLE TO LONG. DEFINE RETURN PARAMETER resultValue AS LONG. END. |