diff --git a/components/onguard/examples/codegen/codegen.lpi b/components/onguard/examples/codegen/codegen.lpi
index ed1e8399f..7a1af2e26 100644
--- a/components/onguard/examples/codegen/codegen.lpi
+++ b/components/onguard/examples/codegen/codegen.lpi
@@ -40,13 +40,13 @@
-
+
-
+
@@ -57,10 +57,9 @@
-
-
-
+
+
@@ -69,7 +68,7 @@
-
+
@@ -118,18 +117,17 @@
-
-
-
+
-
-
-
+
+
+
+
@@ -153,9 +151,11 @@
-
-
+
+
+
+
@@ -199,9 +199,11 @@
-
-
+
+
+
+
@@ -211,48 +213,157 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -284,7 +395,7 @@
-
+
@@ -299,13 +410,6 @@
-
-
-
-
-
-
-
diff --git a/components/onguard/examples/exdmod/exdmod.lpi b/components/onguard/examples/exdmod/exdmod.lpi
index 7bb836592..bb5c24e99 100644
--- a/components/onguard/examples/exdmod/exdmod.lpi
+++ b/components/onguard/examples/exdmod/exdmod.lpi
@@ -74,7 +74,7 @@
-
+
diff --git a/components/onguard/source/ogfile.pas b/components/onguard/source/ogfile.pas
index 2ab32c661..5b99dca40 100644
--- a/components/onguard/source/ogfile.pas
+++ b/components/onguard/source/ogfile.pas
@@ -49,7 +49,7 @@ uses
function GetFileSize(Handle : THandle) : Cardinal;
-{$IFNDEF Win32}
+{$IFNDEF WINDOWS}
function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
@@ -69,7 +69,7 @@ implementation
function GetFileSize(Handle : THandle) : Cardinal;
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
begin
Result := Windows.GetFileSize(Handle, nil);
{$ELSE}
@@ -84,7 +84,7 @@ end;
-{$IFNDEF WIN32}
+{$IFNDEF WINDOWS}
{$ifdef FPC}
diff --git a/components/onguard/source/ogfirst.pas b/components/onguard/source/ogfirst.pas
index 77f1ebb60..88f0ce77e 100644
--- a/components/onguard/source/ogfirst.pas
+++ b/components/onguard/source/ogfirst.pas
@@ -66,7 +66,7 @@ const
implementation
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
var
FirstInstance : Boolean;
InstanceMutex : THandle;
@@ -83,7 +83,7 @@ var
{limit instances routines}
function IsFirstInstance : Boolean;
begin
- {$IFDEF Win32}
+ {$IFDEF WINDOWS}
Result := FirstInstance;
{$ELSE}
{$IFDEF LINUX}
@@ -94,7 +94,7 @@ begin
{$ENDIF}
end;
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
procedure ActivateFirstInstance;
var
ClassBuf,
@@ -149,7 +149,7 @@ end;
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
function GetMutexName : string;
var
WindowBuf : array [0..512] of AnsiChar;
diff --git a/components/onguard/source/ognetwrk.pas b/components/onguard/source/ognetwrk.pas
index d1bff251f..914fd66e9 100644
--- a/components/onguard/source/ognetwrk.pas
+++ b/components/onguard/source/ognetwrk.pas
@@ -423,7 +423,7 @@ begin
end;
end;
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
function IsAppOnNetwork(const ExePath : string) : Boolean;
begin
Result := (GetDriveType(PAnsiChar(ExtractFileDrive(ExePath) + '\')) = DRIVE_REMOTE);
diff --git a/components/onguard/source/ogproexe.pas b/components/onguard/source/ogproexe.pas
index 7a80cfa89..ebe8aac2f 100644
--- a/components/onguard/source/ogproexe.pas
+++ b/components/onguard/source/ogproexe.pas
@@ -152,7 +152,7 @@ function UnprotectExe(const FileName : string) : Boolean;
{checksum/CRC routines}
procedure UpdateChecksum(var Sum : LongInt; const Buf; BufSize : LongInt);
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function FileCRC32(const FileName : string) : DWord; {!!.07}
{$ELSE}
function FileCRC32(const FileName : string) : DWord;//LongInt;
@@ -259,7 +259,7 @@ begin
end;
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function IsExeTampered(CheckSize : Boolean) : TExeStatus;
{-return one of the possible TExeResult states}
var
@@ -374,7 +374,7 @@ begin
end;
{$ENDIF}
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function ProtectExe(const FileName : string; EraseMarker : Boolean) : Boolean;
{-stamp exe with crc and file size. optionally erase search markers}
var
@@ -529,7 +529,7 @@ end;
{$ENDIF}
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function UnprotectExe(const FileName : string) : Boolean;
{-writes uninitialized signature record. marker must not have been erased}
var
@@ -660,7 +660,7 @@ begin
Sum := Sum + Bytes[I];
end;
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function FileCRC32(const FileName : string) : DWord; {!!.07}
var
Fh : THandle;
diff --git a/components/onguard/source/ogsrmgr.pas b/components/onguard/source/ogsrmgr.pas
index dbdb661ce..c6e5cec65 100644
--- a/components/onguard/source/ogsrmgr.pas
+++ b/components/onguard/source/ogsrmgr.pas
@@ -83,7 +83,7 @@ Notes:
--------------------------------------------------------------------
}
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
{include the resource compiled using BRCC32.EXE and SRMC.EXE}
{$R OGSRMGR.R32}
{$ELSE}
@@ -97,7 +97,7 @@ Notes:
{$R-,S-,I-}
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
{$H+} {Long strings} {!!.02}
{$ENDIF}
@@ -139,7 +139,7 @@ const
type
ETpsStringResourceError = class(Exception);
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
TInt32 = Integer;
{$ELSE}
TInt32 = LongInt;
@@ -187,7 +187,7 @@ type
function GetString(Ident : TInt32) : string;
property Strings[Ident : TInt32] : string
read GetString; default;
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function GetWideChar(Ident : TInt32; Buffer : PWideChar; BufChars : Integer) : PWideChar;
{$ENDIF}
@@ -225,7 +225,7 @@ begin
inherited Destroy;
end;
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
procedure WideCopy(Dest, Src : PWideChar; Len : Integer);
begin
while Len > 0 do begin
@@ -479,7 +479,7 @@ end;
initialization
TpsResStrings := TOgStringResource.Create(HInstance, 'OGSRMGR_STRINGS');{!!.01}
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
finalization
FreeTpsResStrings;
{$ELSE}
diff --git a/components/onguard/source/ogutil.pas b/components/onguard/source/ogutil.pas
index 72f8bc98f..aa1017dfe 100644
--- a/components/onguard/source/ogutil.pas
+++ b/components/onguard/source/ogutil.pas
@@ -48,13 +48,10 @@ unit ogutil;
interface
uses
- LCLIntf,lclproc
+ LCLIntf, lclproc
{$IFDEF LINUX} {AH.01}
,BaseUnix
{$ENDIF}
-{$IFDEF WIN32}
-
-{$ENDIF} {AH.01}
,SysUtils
{$IFNDEF IBO_CONSOLE},Dialogs{$ENDIF} {AH.02}
; {!!.08}
@@ -74,7 +71,7 @@ const
const
{largest structure that can be created}
- {$IFDEF Win32}
+ {$IFDEF MSWINDOWS}
MaxStructSize = 1024 * 2000000; {2G}
{$ELSE}
MaxStructSize = 1024 * 64 - 1; {64K}
@@ -242,7 +239,7 @@ const
function BufferToHex(const Buf; BufSize : Cardinal) : string;
function BufferToHexBytes(const Buf; BufSize : Cardinal) : string;
-{$IFNDEF Win32}
+{$IFNDEF WINDOWS}
function GetDiskSerialNumber(Drive : AnsiChar) : LongInt;
function MyHashElf(const Buf; BufSize : LongInt) : LongInt;
{$ENDIF}
@@ -255,7 +252,7 @@ function OgFormatDate(Value : TDateTime) : string; {!!.09}
{file related routines}
function GetFileSize(Handle : THandle) : Cardinal;
-{$IFNDEF Win32}
+{$IFNDEF WINDOWS}
function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): Boolean;
function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
@@ -302,8 +299,9 @@ begin
Result := Result + ',' + HexStr + IntToHex(Bytes[I], 2);
end;
+(********************** removed (16-bit left-over, does not compile any more)...
{$IFNDEF LINUX}
-{$IFNDEF Win32}
+{$IFNDEF MSWINDOWS}
type
PMediaIDRec = ^TMediaIDRec;
TMediaIDRec = packed record
@@ -408,6 +406,7 @@ begin
end;
{$ENDIF}
{$ENDIF}
+*******************************************************************************)
{$IFDEF LINUX}
function MyHashElf(const Buf; BufSize : LongInt) : LongInt;
@@ -543,7 +542,7 @@ not fully compatible but easier pure pascal version
to do it multiplatform}
(*
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
procedure XorMem(var Mem1; const Mem2; Count : Cardinal); register;
begin
asm
@@ -845,7 +844,7 @@ end;
(*
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
function RolByteX(I, C : Byte) : Byte; register;
asm
mov cl, dl
@@ -1157,7 +1156,7 @@ begin
FinalizeTMD(Context, Digest, DigestSize);
end;
-{$IFDEF Win32}
+{$IFDEF MSWINDOWS}
{!!.05} {added}
function CreateMachineID(MachineInfo : TEsMachineInfoSet) : LongInt;
{ Obtains information from:
diff --git a/components/onguard/source/onguard.inc b/components/onguard/source/onguard.inc
index 9504e8375..b0dbb06f0 100644
--- a/components/onguard/source/onguard.inc
+++ b/components/onguard/source/onguard.inc
@@ -47,7 +47,7 @@ Fixme.
{$S-} {Stack-Overflow Checking}
{$V-} {Var-String Checking}
-{$IFNDEF Win32}
+{$IFNDEF MSWINDOWS}
{$F-} {Force Far Calls}
{$K-} {Smart Callbacks}
{$ENDIF}
diff --git a/components/onguard/source/onguard.pas b/components/onguard/source/onguard.pas
index 61beb80ec..fdc818ff6 100644
--- a/components/onguard/source/onguard.pas
+++ b/components/onguard/source/onguard.pas
@@ -45,6 +45,7 @@ interface
uses
{$IFDEF MSWINDOWS} {AH.01}
Windows, {AH.01}
+ idesn, { Serial number info from an IDE hard drive }
{$ENDIF} {AH.01}
{$IFDEF IBO_CONSOLE}
ConsoleStubs,
@@ -52,7 +53,7 @@ uses
{$IFDEF LINUX} {AH.01}
BaseUnix, {AH.01}
{$ENDIF} {AH.01}
- Classes, SysUtils,MD5,
+ Classes, SysUtils, MD5,
ogconst,
ogutil
{$IFNDEF IBO_CONSOLE}
@@ -60,9 +61,6 @@ uses
{$ENDIF}
{$IFDEF UsingZLib}
,ZLib
-{$ENDIF}
-{$IFDEF WIN32}
- ,idesn
{$ENDIF}
;
@@ -822,7 +820,7 @@ begin
FinalizeTMD(Context, Digest, DigestSize);
end;
-{$IFDEF Win32}
+{$IFDEF WINDOWS}
{!!.05} {added}