Search code examples
delphicompiler-constructiondelphi-xe3portable-executable

What are the list of all possible values for DVCLAL?


I was reading SysUtils when I came across with this function:

function ALR: Pointer;
var
  LibModule: PLibModule;
begin
  if MainInstance <> 0 then
    Result := Pointer(LoadResource(MainInstance, FindResource(MainInstance, 'DVCLAL',
      RT_RCDATA)))
  else
  begin

After that, I searched what is DVCLAL and I've found this question.

What are all the possible signatures that Delphi compiler emits to the DVCLAL resource?


Solution

  • There is no official documentation on this, so here is something from my notes of 15+ years ago:

    The DVCLAL is there to check which SKU of Delphi you are using and it varies per SKU.

    There are only checks for the Professional (RPR) and Client/Server (RCS) SKUs:

    procedure RCS;
    
    procedure RPR;
    

    If they fail, they call this method:

    procedure ALV;
    begin
      raise Exception.CreateRes(@SNL);
    end;
    

    where

    resourcestring
      SNL = 'Application is not licensed to use this feature';
    

    Depending on the feature matrix and Delphi version, various components call RPR and RCS in their Create constructors to guarantee a minimum SKU.