Undocumented Delphi directives to set PE OS headers

I recently stumbled across undocumented Delphi directives that were used to set the PE OS headers.

They are as follows:

Compiler directive usage
SETPEOSVERSION set OS Version fields in PE Header
SETPESUBSYSVERSION set Subsystem Version fields in PE Header
SETPEUSERVERSION set User Version fields in PE Header

The usage for these directives are as follows:

{$SETPEOSVERSION major.minor}

These compiler directives were probably introduced at the same time that the command line compiler introduced these, which was probably in Delphi 2010.

Published Sat, 31 May 2014 @ 8:42 PM by chuacw

Leave a Comment

Enter the following code to ensure that your comment reaches the intended party:
Enter the numbers you see in the image: