Trying to decrypt a programmerβs previous intention leads to another possibility ....
It seems the Delphi 2009 application has been fixed due to string type changes . I am sure that you do not want to invent all the corrections that another programmer has already made.
Looking at the code, Delphi 2009 is intended to compile the following line (which does not use StrPas):
StrCopy(pSerialNumber, @Buf[pDevDesc.SerialNumberOffset + 1]);
Delphi ( StrPas):
StrPCopy(pSerialNumber,
FlipAndCodeBytes(StrPas(@Buf[pDevDesc.SerialNumberOffset + 1])));
Delphi XE-6 " ", , .
, NEWVER. , , NEWVER , . , include . ( , .)
NEWVER . , 2009 " " - XE6 " ".
, :
{$IF CompilerVersion >= 20.0} //>= Delphi 2009
StrCopy(pSerialNumber, @Buf[pDevDesc.SerialNumberOffset + 1]);
{$ELSE}
StrPCopy(pSerialNumber,
FlipAndCodeBytes(StrPas(@Buf[pDevDesc.SerialNumberOffset + 1])));
{$IFEND}
. :
http://docwiki.embarcadero.com/RADStudio/XE7/en/Conditional_compilation_(Delphi)
http://docwiki.embarcadero.com/RADStudio/XE7/en/Compiler_Versions
Delphi ( Delphi 6, ), :
{$IFDEF CONDITIONALEXPRESSIONS}
{$IF CompilerVersion >= 20.0} //>= Delphi 2009
StrCopy(pSerialNumber, @Buf[pDevDesc.SerialNumberOffset + 1]);
{$ELSE} //< Delphi 2009
StrPCopy(pSerialNumber,
FlipAndCodeBytes(StrPas(@Buf[pDevDesc.SerialNumberOffset + 1])));
{$IFEND}
{$ELSE} //< Delphi 6
StrPCopy(pSerialNumber,
FlipAndCodeBytes(StrPas(@Buf[pDevDesc.SerialNumberOffset + 1])));
{$ENDIF}