Thema: Delphi SMTP über Strato

Einzelnen Beitrag anzeigen

Edelfix

Registriert seit: 6. Feb 2015
Ort: Stadtoldendorf
214 Beiträge
 
Delphi 10.4 Sydney
 
#9

AW: SMTP über Strato

  Alt 3. Jan 2023, 14:42
Delphi-Quellcode:
unit CheckOpenSSLUnit;

interface

uses WinApi.Windows, System.SysUtils, vcl.Dialogs;

  procedure CheckOpenSSL;

implementation

procedure CheckOpenSSL;
var
  ssleay32, libeay32: HMODULE;
  ModulePath: array[0..MAX_PATH] of Char;
  VerInfoSize: Cardinal;
  VerInfo: Pointer;
  VerValueSize: Cardinal;
  VerValue: PVSFixedFileInfo;
  sPathSsleay32: string;
  sPathLibeay32: string;
  sVerInfoSsleay32: String;
  sVerInfoLibeay32: String;
  Dummy: Cardinal;
begin
  ssleay32 := LoadLibrary('ssleay32.dll');
  if ssleay32 <> 0 then
  begin
    Dummy := ssleay32;
    GetModuleFileName(ssleay32, ModulePath, length(ModulePath));
    sPathSsleay32 := String(ModulePath);
    //--
    VerInfoSize := GetFileVersionInfoSize(PChar(sPathSsleay32), Dummy);
    GetMem(VerInfo, VerInfoSize);
    GetFileVersionInfo(PChar(sPathSsleay32), 0, VerInfoSize, VerInfo);
    VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
    sVerInfoSsleay32 := 'Version '+IntToStr(VerValue^.dwFileVersionMS shr 16);
    sVerInfoSsleay32 := sVerInfoSsleay32 + '.' + IntToStr(VerValue^.dwFileVersionMS and $FFFF);
    sVerInfoSsleay32 := sVerInfoSsleay32 + '.' + IntToStr(VerValue^.dwFileVersionLS shr 16);
    sVerInfoSsleay32 := sVerInfoSsleay32 + '.' + IntToStr(VerValue^.dwFileVersionLS and $FFFF);
  end;

  libeay32 := LoadLibrary('libeay32.dll');
  if libeay32 <> 0 then
  begin
    Dummy := libeay32;
    GetModuleFileName(libeay32, ModulePath, length(ModulePath));
    sPathLibeay32 := String(ModulePath);
    //--
    VerInfoSize := GetFileVersionInfoSize(PChar(sPathLibeay32), Dummy);
    GetMem(VerInfo, VerInfoSize);
    GetFileVersionInfo(PChar(sPathLibeay32), 0, VerInfoSize, VerInfo);
    VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
    sVerInfoLibeay32 := 'Version '+IntToStr(VerValue^.dwFileVersionMS shr 16);
    sVerInfoLibeay32 := sVerInfoLibeay32 + '.' + IntToStr(VerValue^.dwFileVersionMS and $FFFF);
    sVerInfoLibeay32 := sVerInfoLibeay32 + '.' + IntToStr(VerValue^.dwFileVersionLS shr 16);
    sVerInfoLibeay32 := sVerInfoLibeay32 + '.' + IntToStr(VerValue^.dwFileVersionLS and $FFFF);
  end;
  Showmessage(sPathSsleay32+' - '+sVerInfoSsleay32+#10+sPathLibeay32+' - '+sVerInfoLibeay32);
end;

end.
  Mit Zitat antworten Zitat