From e5bb0cd561e27027c9f5f445c7baa203bda16fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Sun, 2 Sep 2018 15:40:56 +0200 Subject: [PATCH] Improved Is32BitProcess function. --- source/uCEFConstants.pas | 1 - source/uCEFMiscFunctions.pas | 57 +++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/source/uCEFConstants.pas b/source/uCEFConstants.pas index 43b139dc..54656602 100644 --- a/source/uCEFConstants.pas +++ b/source/uCEFConstants.pas @@ -402,7 +402,6 @@ const CEF4DELPHI_URL = 'https://github.com/salvadordf/CEF4Delphi'; CRLF = #13 + #10; - // Bitness constants used in IMAGE_FILE_MACHINE_UNKNOWN = 0; IMAGE_FILE_MACHINE_I386 = $014c; // Intel x86 IMAGE_FILE_MACHINE_IA64 = $0200; // Intel Itanium Processor Family (IPF) diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 18949a8a..218e2caa 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -1204,7 +1204,7 @@ begin end; except on e : exception do - if CustomExceptionHandler('GetDLLBitness', e) then raise; + if CustomExceptionHandler('GetDLLHeaderMachine', e) then raise; end; finally if (TempStream <> nil) then FreeAndNil(TempStream); @@ -1222,11 +1222,66 @@ begin exit; {$ENDIF} + {$IFDEF CPU386} + Result := True; + exit; + {$ENDIF} + + {$IFDEF CPUi386} + Result := True; + exit; + {$ENDIF} + + {$IFDEF CPUPOWERPC32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF CPUSPARC32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF CPU32BITS} + Result := True; + exit; + {$ENDIF} + + {$IFDEF CPUARM32} + Result := True; + exit; + {$ENDIF} + {$IFDEF WIN32} Result := True; exit; {$ENDIF} + {$IFDEF IOS32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF MACOS32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF LINUX32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF POSIX32} + Result := True; + exit; + {$ENDIF} + + {$IFDEF ANDROID32} + Result := True; + exit; + {$ENDIF} + {$IFDEF MSWINDOWS} Result := ProcessUnderWow64(GetCurrentProcess, TempResult) and TempResult; exit;