1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-12-04 09:26:52 +02:00

Improved Is32BitProcess function.

This commit is contained in:
Salvador Díaz Fau 2018-09-02 15:40:56 +02:00
parent 7342cccbb5
commit e5bb0cd561
2 changed files with 56 additions and 2 deletions

View File

@ -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)

View File

@ -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;