Windows AWE

AWE version 1.3

Author: Amine Moulay Ramdane

Description:

Why the 2 GB limitation on the Win 32bits systems ?

My AWE object pascal module is here, it allows your 32 bit application to use up to 64GB of RAM

Please read this:

http://www.technologyfirst.org/magazine-articles/33-january-2008/201-addressing-memory-above-4gb-on-windows-32-bit.html

And read this , my AWE does work perfectly on 64 bit windows systems:

http://sqlblog.com/blogs/argenis_fernandez/archive/2012/12/30/the-myth-around-32-bit-sql-server-instances-on-64-bit-operating-systems-and-awe.aspx

And here is the public interfaces of TAWEMem and TAWEStream classes, i have implemented the following methods:

TAWEStream = class

public

Memory:pointer;

allocated:boolean;

Size:longword;

position:longint;

PageSize:integer;

constructor Create(ulBytes: longint);

destructor Destroy(); override;

function HowManyPagesAllocated(): ulong;

function Seek(Offset: longint; Origin: Word): longint;

function CopyFrom(in_stream:TStream;count:longint):longint;

function CopyTo(out_stream:TStream;count:longint):longint;

function Read(var Buffer;count:longint):longint;

function Write(const Buffer;count:longint):longint;

procedure LoadFromStream(in_stream: TStream);

procedure LoadFromFile(const FileName: string);

function ToString:string;

published

property TotalMem:int64 read gettotalmem;

property AvailMem:int64 read getavailmem;

property MemLoad:int64 read getmemload;

end;

TAWEMem = class

public

memory:pointer;

allocated:boolean;

Size:lonword;

PageSize:integer;

constructor Create(ulBytes: ULONG);

destructor Destroy(); override;

function HowManyPagesAllocated(): ULONG;

end;

Note: To be able to use AWE you have to set the user rights correctly, so, go to:

Control Panel -> Administrative tools -> Local Security Policy -> User Rights Assignment and give 'Lock pages in memory' right to the user that wants to use AWE and reboot the system..

Every TAWEMem object can go up to 2GB of memory and every TAWEStream can go up to 2GB of memory, and you can go up to 64GB of memory !

And please look at the test examples 'test.pas' and 'test1.pas' inside the zipfile - compile and execute them... -

You can go to download the zip files by clicking on the following web link:

https://drive.google.com/drive/folders/13HXZGsp9Jt4DiAE_lv4KNpjEFQXpmGhe?usp=sharing

Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freepascal.org/

Operating Systems: Windows 2000 and up (x86).

Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal

-Sd for delphi mode....

Required Delphi switches: -DMSWINDOWS -$H+

For Delphi use -DDelphi