Delphi-Quellcode:
program Test;
{$APPTYPE CONSOLE}
uses
SysUtils,
Registry,
Windows;
var
Reg : TRegistry;
buf: array[0..3] of byte;
begin
buf[0] := $01;
buf[1] := $00;
buf[2] := $00;
buf[3] := $00;
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('SYSTEM', False);
Reg.CreateKey('Parameters');
Reg.OpenKey('Parameters', False);
Reg.WriteBinaryData('Test', @buf, 4);
Reg.CloseKey;
Reg.Free;
end.
Here is an error: [Error] Project1.dpr(25): Constant object cannot be passed as var parameter