uses
Winapi.Windows, System.SysUtils,
FireDAC.Stan.Consts, FireDAC.Phys.MySQLWrapper;
procedure AllowFireDACMariaDBVersions;
implementation
type
THackMySQLLib =
class(TMySQLLib);
function GetIncrement: Integer;
begin
Result := 0;
if CompilerVersion >= 31
then
begin
Result := $73;
end else if CompilerVersion <= 27
then
begin
Result := $77;
end;
end;
procedure SetMaxMySQLLib(
const AValue: Integer);
var
ConstAddr: PByte;
OldProtect: DWORD;
Increment: Integer;
begin
ConstAddr := PByte(@THackMySQLLib.LoadEntries);
Increment := GetIncrement;
Inc(ConstAddr, Increment);
VirtualProtect(ConstAddr, SizeOf(mvMySQL060200), PAGE_READWRITE, OldProtect);
if mvMySQL060200 <> PInteger(ConstAddr)^
then
begin
raise Exception.Create('
Interner Fehler: Maximale MySQL Versionsnummer konnte nicht korrigiert werden!');
end;
PInteger(ConstAddr)^ := AValue;
VirtualProtect(ConstAddr, SizeOf(mvMySQL060200), OldProtect, OldProtect);
end;
procedure AllowFireDACMariaDBVersions;
begin
SetMaxMySQLLib(2000000000);
end;