git-svn-id: https://svn.code.sf.net/p/kolmck/code@40 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
This commit is contained in:
2
KOL.pas
2
KOL.pas
@ -54042,7 +54042,7 @@ end;
|
|||||||
var SaveWinVer: Byte = $FF;
|
var SaveWinVer: Byte = $FF;
|
||||||
|
|
||||||
//[function WinVer]
|
//[function WinVer]
|
||||||
{$IFDEF nonononoASM_VERSION}
|
{$IFDEF ASM_VERSION}
|
||||||
{$ELSE ASM_VERSION}
|
{$ELSE ASM_VERSION}
|
||||||
function WinVer : TWindowsVersion;
|
function WinVer : TWindowsVersion;
|
||||||
var MajorVersion, MinorVersion: Byte;
|
var MajorVersion, MinorVersion: Byte;
|
||||||
|
36
KOL_ASM.inc
36
KOL_ASM.inc
@ -17890,7 +17890,7 @@ asm //cmd //opd
|
|||||||
//@@exit: XCHG EAX, ECX
|
//@@exit: XCHG EAX, ECX
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{function WinVer : TWindowsVersion;
|
function WinVer : TWindowsVersion;
|
||||||
asm
|
asm
|
||||||
MOVSX EAX, byte ptr [SaveWinVer]
|
MOVSX EAX, byte ptr [SaveWinVer]
|
||||||
INC AH // ���� <> 0 ����� ����������, �� AL �������� ����������� ������
|
INC AH // ���� <> 0 ����� ����������, �� AL �������� ����������� ������
|
||||||
@ -17900,21 +17900,31 @@ asm
|
|||||||
XOR EAX, EAX
|
XOR EAX, EAX
|
||||||
TEST EDX, EDX
|
TEST EDX, EDX
|
||||||
XCHG DL, DH // DH=MajorVersion; DL=MinorVersion
|
XCHG DL, DH // DH=MajorVersion; DL=MinorVersion
|
||||||
|
|
||||||
JL @@platform_9x
|
JL @@platform_9x
|
||||||
MOV AL, wvNT
|
MOV AL, wvNT
|
||||||
CMP DH, 5
|
CMP DX, $0400
|
||||||
JB @@save_exit
|
|
||||||
INC AL // wvY2K
|
|
||||||
CMP DX, $0501
|
|
||||||
JB @@save_exit
|
|
||||||
INC AL // wvXP
|
|
||||||
DEC DL
|
|
||||||
JZ @@save_exit
|
JZ @@save_exit
|
||||||
INC AL // wvServer2003
|
|
||||||
CMP DH, 6
|
INC AL // wvY2K
|
||||||
JB @@save_exit
|
CMP DX, $0500
|
||||||
|
JZ @@save_exit
|
||||||
|
|
||||||
|
INC AL // wvXP
|
||||||
|
CMP DX, $0501
|
||||||
|
JZ @@save_exit
|
||||||
|
|
||||||
|
INC AL // wvWin2003Server
|
||||||
|
CMP DX, $0502
|
||||||
|
JZ @@save_exit
|
||||||
|
|
||||||
INC AL // wvVista
|
INC AL // wvVista
|
||||||
JMP @@save_exit
|
CMP DX, $0600
|
||||||
|
JZ @@save_exit
|
||||||
|
|
||||||
|
INC AL // wvSeven
|
||||||
|
CMP DX, $0601
|
||||||
|
JZ @@save_exit
|
||||||
@@platform_9x:
|
@@platform_9x:
|
||||||
CMP DH, 4
|
CMP DH, 4
|
||||||
JB @@save_exit // wv31
|
JB @@save_exit // wv31
|
||||||
@ -17928,7 +17938,7 @@ asm
|
|||||||
@@save_exit:
|
@@save_exit:
|
||||||
MOV byte ptr [SaveWinVer], AL
|
MOV byte ptr [SaveWinVer], AL
|
||||||
@@exit:
|
@@exit:
|
||||||
end;}
|
end;
|
||||||
|
|
||||||
//======================================== THE END OF FILE KOL_ASM.inc
|
//======================================== THE END OF FILE KOL_ASM.inc
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ var
|
|||||||
{ DllProcEx passes the Reserved param provided by WinNT on DLL load & exit }
|
{ DllProcEx passes the Reserved param provided by WinNT on DLL load & exit }
|
||||||
DllProcEx: TDLLProcEx absolute DllProc;
|
DllProcEx: TDLLProcEx absolute DllProc;
|
||||||
DataMark: Integer = 0; { Used to find the virtual base of DATA seg }
|
DataMark: Integer = 0; { Used to find the virtual base of DATA seg }
|
||||||
CoverageLibraryName: array [0..128] of char = '*'; { initialized by the linker! }
|
CoverageLibraryName: array [0..128] of Char = '*'; { initialized by the linker! }
|
||||||
{$IFDEF ELF}
|
{$IFDEF ELF}
|
||||||
TypeImportsTable: array [0..0] of Pointer platform; { VMT and RTTI imports table for exes }
|
TypeImportsTable: array [0..0] of Pointer platform; { VMT and RTTI imports table for exes }
|
||||||
_GLOBAL_OFFSET_TABLE_: ARRAY [0..2] OF Cardinal platform;
|
_GLOBAL_OFFSET_TABLE_: ARRAY [0..2] OF Cardinal platform;
|
||||||
|
@ -1251,6 +1251,8 @@ function Ln(const X: Extended): Extended;
|
|||||||
function ArcTan(const X: Extended): Extended;
|
function ArcTan(const X: Extended): Extended;
|
||||||
function Sqrt(const X: Extended): Extended;
|
function Sqrt(const X: Extended): Extended;
|
||||||
|
|
||||||
|
{ Procedures and functions that need compiler magic }
|
||||||
|
|
||||||
procedure _ROUND;
|
procedure _ROUND;
|
||||||
procedure _TRUNC;
|
procedure _TRUNC;
|
||||||
|
|
||||||
@ -1616,7 +1618,11 @@ type
|
|||||||
reVarDispatch, reVarArrayCreate, reVarNotArray, reVarArrayBounds,
|
reVarDispatch, reVarArrayCreate, reVarNotArray, reVarArrayBounds,
|
||||||
reAssertionFailed,
|
reAssertionFailed,
|
||||||
reExternalException, { not used here; in SysUtils }
|
reExternalException, { not used here; in SysUtils }
|
||||||
reIntfCastError, reSafeCallError);
|
reIntfCastError, reSafeCallError
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
, reQuit, reCodesetConversion
|
||||||
|
{$ENDIF}
|
||||||
|
);
|
||||||
{$NODEFINE TRuntimeError}
|
{$NODEFINE TRuntimeError}
|
||||||
|
|
||||||
procedure Error(errorCode: TRuntimeError);
|
procedure Error(errorCode: TRuntimeError);
|
||||||
@ -2144,7 +2150,7 @@ function _fxstat(Version: Integer; Handle: Integer; var Stat: TStatStruct): Inte
|
|||||||
|
|
||||||
function __xstat(Ver: Integer; FileName: PChar; var StatBuffer: TStatStruct): Integer; cdecl;
|
function __xstat(Ver: Integer; FileName: PChar; var StatBuffer: TStatStruct): Integer; cdecl;
|
||||||
external libc name '__xstat';
|
external libc name '__xstat';
|
||||||
|
|
||||||
function _strlen(P: PChar): Integer; cdecl;
|
function _strlen(P: PChar): Integer; cdecl;
|
||||||
external libc name 'strlen';
|
external libc name 'strlen';
|
||||||
|
|
||||||
@ -2249,9 +2255,9 @@ end;
|
|||||||
type
|
type
|
||||||
PMemInfo = ^TMemInfo;
|
PMemInfo = ^TMemInfo;
|
||||||
TMemInfo = packed record
|
TMemInfo = packed record
|
||||||
BaseAddress: Pointer;
|
BaseAddress: Pointer;
|
||||||
AllocationBase: Pointer;
|
AllocationBase: Pointer;
|
||||||
AllocationProtect: Longint;
|
AllocationProtect: Longint;
|
||||||
RegionSize: Longint;
|
RegionSize: Longint;
|
||||||
State: Longint;
|
State: Longint;
|
||||||
Protect: Longint;
|
Protect: Longint;
|
||||||
@ -2640,20 +2646,25 @@ end;
|
|||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
////
|
||||||
|
{$I FastMM.inc}
|
||||||
|
|
||||||
|
const
|
||||||
|
DelphiMemoryManager: TMemoryManager = (
|
||||||
|
GetMem: SysGetMem;
|
||||||
|
FreeMem: SysFreeMem;
|
||||||
|
ReallocMem: SysReallocMem);
|
||||||
|
|
||||||
|
HeapMemoryManager: TMemoryManager = (
|
||||||
|
GetMem: DfltGetMem;
|
||||||
|
FreeMem: DfltFreeMem;
|
||||||
|
ReallocMem: DfltReallocMem);
|
||||||
|
|
||||||
{X- by default, system memory allocation routines (API calls)
|
{X- by default, system memory allocation routines (API calls)
|
||||||
are used. To use Inprise's memory manager (Delphi standard)
|
are used. To use Inprise's memory manager (Delphi standard)
|
||||||
call UseDelphiMemoryManager procedure. }
|
call UseDelphiMemoryManager procedure. }
|
||||||
var
|
var
|
||||||
MemoryManager: TMemoryManager = (
|
MemoryManager: TMemoryManager;
|
||||||
GetMem: DfltGetMem;
|
|
||||||
FreeMem: DfltFreeMem;
|
|
||||||
ReallocMem: DfltReallocMem);
|
|
||||||
|
|
||||||
const
|
|
||||||
DelphiMemoryManager: TMemoryManager = (
|
|
||||||
GetMem: SysGetMem;
|
|
||||||
FreeMem: SysFreeMem;
|
|
||||||
ReallocMem: SysReallocMem);
|
|
||||||
|
|
||||||
procedure UseDelphiMemoryManager;
|
procedure UseDelphiMemoryManager;
|
||||||
begin
|
begin
|
||||||
@ -19155,7 +19166,6 @@ end;
|
|||||||
{X} end;
|
{X} end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
{$IFDEF USE_PROCESS_HEAP}
|
{$IFDEF USE_PROCESS_HEAP}
|
||||||
HeapHandle := GetProcessHeap;
|
HeapHandle := GetProcessHeap;
|
||||||
@ -19163,6 +19173,9 @@ initialization
|
|||||||
HeapHandle := HeapCreate( 0, 0, 0 );
|
HeapHandle := HeapCreate( 0, 0, 0 );
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
SetMemoryManager(HeapMemoryManager);
|
||||||
|
//UseDelphiMemoryManager;
|
||||||
|
Install_FastMM;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
//{X (initialized statically} FileMode := 2;
|
//{X (initialized statically} FileMode := 2;
|
||||||
@ -19218,5 +19231,4 @@ finalization
|
|||||||
{X UninitAllocator; - replaced with call to UninitMemoryManager handler. }
|
{X UninitAllocator; - replaced with call to UninitMemoryManager handler. }
|
||||||
UninitMemoryManager;
|
UninitMemoryManager;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end.
|
end.
|
||||||
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
22.09.09
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
* �������� ������� ������� WinVer (MTsvDN)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
09.09.09 %)
|
09.09.09 %)
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user