mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 22:07:56 +02:00
* RealMaxPathLen added - value queried from the system on startup
git-svn-id: trunk@25011 -
This commit is contained in:
parent
94cf650d9a
commit
67b3017751
@ -416,3 +416,7 @@ const
|
||||
|
||||
function DosQueryMem (P: pointer; var Size, Flag: cardinal): cardinal; cdecl;
|
||||
external 'DOSCALLS' index 306;
|
||||
|
||||
function DosQuerySysInfo (First, Last: cardinal; var Buf; BufSize: cardinal):
|
||||
cardinal; cdecl;
|
||||
external 'DOSCALLS' index 348;
|
||||
|
@ -44,8 +44,12 @@ const
|
||||
AllowDriveSeparators : set of char = [':'];
|
||||
{ FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
|
||||
MaxExitCode = 65535;
|
||||
MaxPathLen = 256;
|
||||
MaxPathLen = 260;
|
||||
(* MaxPathLen is referenced as constant from unit SysUtils *)
|
||||
(* - changing to variable or typed constant is not possible. *)
|
||||
AllFilesMask = '*';
|
||||
RealMaxPathLen: word = MaxPathLen;
|
||||
(* Default value only - real value queried from the system on startup. *)
|
||||
|
||||
type Tos=(osDOS,osOS2,osDPMI);
|
||||
|
||||
@ -1082,6 +1086,7 @@ var TIB: PThreadInfoBlock;
|
||||
ErrStr: string;
|
||||
P: pointer;
|
||||
DosCallsHandle: THandle;
|
||||
DW: cardinal;
|
||||
|
||||
const
|
||||
DosCallsName: array [0..8] of char = 'DOSCALLS'#0;
|
||||
@ -1132,6 +1137,10 @@ begin
|
||||
ThreadID := TIB^.TIB2^.TID;
|
||||
IsConsole := ApplicationType <> 3;
|
||||
|
||||
{Query maximum path length (QSV_MAX_PATH_LEN = 1)}
|
||||
if DosQuerySysInfo (1, 1, @DW, SizeOf (DW)) = 0 then
|
||||
RealMaxPathLen := DW;
|
||||
|
||||
ExitProc := nil;
|
||||
|
||||
{$IFDEF OS2EXCEPTIONS}
|
||||
|
Loading…
Reference in New Issue
Block a user