diff --git a/source/Jcl.cbproj b/source/Jcl.cbproj index a3a14be3e..2b358cc88 100644 --- a/source/Jcl.cbproj +++ b/source/Jcl.cbproj @@ -97,6 +97,9 @@ 0 + + 14 + 3 @@ -130,6 +133,9 @@ 12 + + 15 + 13 diff --git a/source/forms/About.cpp b/source/forms/About.cpp index fc5e4159a..dbfa614f6 100644 --- a/source/forms/About.cpp +++ b/source/forms/About.cpp @@ -283,7 +283,7 @@ void __fastcall TAboutDialog::DoLoadThirdParty() #endif UnicodeString JclVersion = - FormatVersion(JclVersionMajor, JclVersionMinor, JclVersionRelease); + FormatVersion(JclVersionMajor, JclVersionMinor, JclVersionRelease) + L" " + JclCommit; AddPara(ThirdParty, FMTLOAD(ABOUT_JCL, (JclVersion)) + Br + CreateLink(LoadStr(ABOUT_JCL_URL))); diff --git a/source/packages/jcl/JclAnsiStrings.pas b/source/packages/jcl/JclAnsiStrings.pas index fd65d29ea..10e167fbb 100644 --- a/source/packages/jcl/JclAnsiStrings.pas +++ b/source/packages/jcl/JclAnsiStrings.pas @@ -527,7 +527,9 @@ function StrIdent(const S: AnsiString; var Index: SizeInt; out Ident: AnsiString function StrIdent(var S: PAnsiChar; out Ident: AnsiString): Boolean; overload; function StrToFloatSafe(const S: AnsiString): Float; function StrToIntSafe(const S: AnsiString): Integer; +{$IFNDEF WINSCP} procedure StrNormIndex(const StrLen: SizeInt; var Index: SizeInt; var Count: SizeInt); overload; +{$ENDIF} function ArrayOf(List: TJclAnsiStrings): TDynStringArray; overload; @@ -606,7 +608,7 @@ uses {$ENDIF} {$ENDIF HAS_UNIT_RTLCONSTS} {$ENDIF SUPPORTS_UNICODE} - JclLogic, JclResources, JclStreams, JclSynch, JclSysUtils; + {$IFNDEF WINSCP}JclLogic,{$ENDIF WINSCP} JclResources, JclStreams, JclSynch, JclSysUtils; //=== Internal =============================================================== @@ -4007,11 +4009,13 @@ begin Result := Trunc(StrToFloatSafe(S)); end; +{$IFNDEF WINSCP} procedure StrNormIndex(const StrLen: SizeInt; var Index: SizeInt; var Count: SizeInt); overload; begin Index := Max(1, Min(Index, StrLen + 1)); Count := Max(0, Min(Count, StrLen + 1 - Index)); end; +{$ENDIF WINSCP} function ArrayOf(List: TJclAnsiStrings): TDynStringArray; var diff --git a/source/packages/jcl/JclBase.pas b/source/packages/jcl/JclBase.pas index 716229d25..32085775c 100644 --- a/source/packages/jcl/JclBase.pas +++ b/source/packages/jcl/JclBase.pas @@ -64,6 +64,7 @@ const JclVersionMinor = 8; // Fifth minor release since JCL 1.90 JclVersionRelease = 0; // 0: pre-release|beta/ 1: release JclVersionBuild = 5677; // build number, days since march 1, 2000 + JclCommit = '6380ce72'; JclVersion = (JclVersionMajor shl 24) or (JclVersionMinor shl 16) or (JclVersionRelease shl 15) or (JclVersionBuild shl 0); diff --git a/source/packages/jcl/JclDebug.pas b/source/packages/jcl/JclDebug.pas index 7e6858eb5..33c037a7b 100644 --- a/source/packages/jcl/JclDebug.pas +++ b/source/packages/jcl/JclDebug.pas @@ -1131,25 +1131,9 @@ uses System.AnsiStrings, {$ENDIF ~WINSCP} {$ENDIF MSWINDOWS} - JclHookExcept, {$IFNDEF WINSCP}JclAnsiStrings,{$ENDIF ~WINSCP} JclStrings, JclSysInfo, JclSysUtils, JclWin32, + JclHookExcept, JclAnsiStrings, JclStrings, JclSysInfo, JclSysUtils, JclWin32, {$IFNDEF WINSCP}JclStringConversions,{$ENDIF ~WINSCP} JclResources; -{$IFDEF WINSCP} - -// from JclAnsiStrings.pas - -function StrLICompA(const Str1, Str2: PAnsiChar; MaxLen: Cardinal): Integer; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrIComp(Str1, Str2); -end; - -function StrPLCopyA(Dest: PAnsiChar; const Source: AnsiString; MaxLen: Cardinal): PAnsiChar; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrPLCopy(Dest, Source, MaxLen); -end; - -{$ENDIF} - //=== Helper assembler routines ============================================== const @@ -4440,13 +4424,13 @@ begin end; end; -{$ENDIF ~WINSCP} - procedure TJclDebugInfoTD32.GenerateUnmangledNames; begin FImage.TD32Scanner.GenerateUnmangledNames; end; +{$ENDIF ~WINSCP} + {$ENDIF BORLAND} //=== { TJclDebugInfoSymbols } =============================================== diff --git a/source/packages/jcl/JclFileUtils.pas b/source/packages/jcl/JclFileUtils.pas index e6599d814..15e2b6e86 100644 --- a/source/packages/jcl/JclFileUtils.pas +++ b/source/packages/jcl/JclFileUtils.pas @@ -307,7 +307,9 @@ function GetSizeOfFile(const FileName: string): Int64; overload; function GetSizeOfFile(const FileInfo: TSearchRec): Int64; overload; {$IFDEF MSWINDOWS} function GetSizeOfFile(Handle: THandle): Int64; overload; +{$IFNDEF WINSCP} function GetStandardFileInfo(const FileName: string): TWin32FileAttributeData; +{$ENDIF} {$ENDIF MSWINDOWS} function IsDirectory(const FileName: string {$IFDEF UNIX}; ResolveSymLinks: Boolean = True {$ENDIF}): Boolean; function IsRootDirectory(const CanonicFileName: string): Boolean; @@ -4395,6 +4397,7 @@ function GetFileAttributesEx(lpFileName: PChar; external kernel32 name 'GetFileAttributesExA'; {$ENDIF FPC} +{$IFNDEF WINSCP} function GetStandardFileInfo(const FileName: string): TWin32FileAttributeData; var Handle: THandle; @@ -4428,6 +4431,7 @@ begin raise EJclFileUtilsError.CreateResFmt(@RsFileUtilsAttrUnavailable, [FileName]); end; end; +{$ENDIF} {$ENDIF MSWINDOWS} diff --git a/source/packages/jcl/JclPeImage.pas b/source/packages/jcl/JclPeImage.pas index 919402d72..350740bc6 100644 --- a/source/packages/jcl/JclPeImage.pas +++ b/source/packages/jcl/JclPeImage.pas @@ -1129,7 +1129,7 @@ uses Character, {$ENDIF HAS_UNIT_CHARACTER} {$ENDIF ~HAS_UNITSCOPE} - {$IFNDEF WINSCP}JclLogic,{$ELSE}Math, System.AnsiStrings, {$ENDIF ~WINSCP} JclResources, JclSysUtils, {$IFNDEF WINSCP}JclAnsiStrings,{$ENDIF ~WINSCP} JclStrings{$IFNDEF WINSCP}, JclStringConversions{$ENDIF ~WINSCP}, JclTD32; + {$IFNDEF WINSCP}JclLogic,{$ELSE}Math, System.AnsiStrings, {$ENDIF ~WINSCP} JclResources, JclSysUtils, JclAnsiStrings, JclStrings{$IFNDEF WINSCP}, JclStringConversions{$ENDIF ~WINSCP}, JclTD32; const MANIFESTExtension = '.manifest'; @@ -1166,28 +1166,6 @@ end; const UnixTimeStart = UnixDateDelta; -// from JclAnsiStrings.pas - -function StrLCompA(const Str1, Str2: PAnsiChar; MaxLen: Cardinal): Integer; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrLComp(Str1, Str2, MaxLen); -end; - -function StrPLCopyA(Dest: PAnsiChar; const Source: AnsiString; MaxLen: Cardinal): PAnsiChar; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrPLCopy(Dest, Source, MaxLen); -end; - -function StrICompA(const Str1, Str2: PAnsiChar): Integer; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrIComp(Str1, Str2); -end; - -function StrLenA(S: PAnsiChar): Integer; -begin - Result := {$IFDEF DEPRECATED_SYSUTILS_ANSISTRINGS}System.AnsiStrings.{$ENDIF}StrLen(S); -end; - {$ENDIF} // Helper routines diff --git a/source/packages/jcl/JclStrings.pas b/source/packages/jcl/JclStrings.pas index 598b9b196..8e4a592e1 100644 --- a/source/packages/jcl/JclStrings.pas +++ b/source/packages/jcl/JclStrings.pas @@ -83,8 +83,8 @@ uses {$ENDIF UNICODE_RTL_DATABASE} Classes, SysUtils, {$ENDIF ~HAS_UNITSCOPE} -{$IFNDEF WINSCP} JclAnsiStrings, +{$IFNDEF WINSCP} JclWideStrings, {$ENDIF ~WINSCP} JclBase; diff --git a/source/packages/jcl/JclSysInfo.pas b/source/packages/jcl/JclSysInfo.pas index 8bc35c5dc..bc1e79847 100644 --- a/source/packages/jcl/JclSysInfo.pas +++ b/source/packages/jcl/JclSysInfo.pas @@ -113,11 +113,15 @@ procedure SetGlobalEnvironmentVariable(VariableName, VariableContent: string); // Common Folder Locations {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} function GetCommonFilesFolder: string; +{$ENDIF WINSCP} {$ENDIF MSWINDOWS} function GetCurrentFolder: string; {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} function GetProgramFilesFolder: string; +{$ENDIF WINSCP} function GetWindowsFolder: string; function GetWindowsSystemFolder: string; function GetWindowsTempFolder: string; @@ -211,9 +215,11 @@ function GetWorkGroupName: WideString; {$ENDIF MSWINDOWS} function GetDomainName: string; {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} function GetRegisteredCompany: string; function GetRegisteredOwner: string; function GetWindowsProductId: string; +{$ENDIF WINSCP} function GetBIOSName: string; function GetBIOSCopyright: string; function GetBIOSExtendedInfo: string; @@ -226,7 +232,9 @@ function GetBIOSDate: TDateTime; type TJclTerminateAppResult = (taError, taClean, taKill); +{$IFNDEF WINSCP} function RunningProcessesList(const List: TStrings; FullPath: Boolean = True): Boolean; +{$ENDIF WINSCP} {$IFDEF MSWINDOWS} function LoadedModulesList(const List: TStrings; ProcessID: DWORD; HandlesOnly: Boolean = False): Boolean; @@ -250,17 +258,21 @@ function TerminateApp(ProcessID: DWORD; Timeout: Integer): TJclTerminateAppResul {$IFDEF MSWINDOWS} {.$IFNDEF FPC} +{$IFNDEF WINSCP} function GetPidFromProcessName(const ProcessName: string): THandle; function GetProcessNameFromWnd(Wnd: THandle): string; function GetProcessNameFromPid(PID: DWORD): string; +{$ENDIF WINSCP} function GetMainAppWndFromPid(PID: DWORD): THandle; function GetWndFromPid(PID: DWORD; const WindowClassName: string): HWND; {.$ENDIF ~FPC} +{$IFNDEF WINSCP} function GetShellProcessName: string; {.$IFNDEF FPC} function GetShellProcessHandle: THandle; {.$ENDIF ~FPC} +{$ENDIF WINSCP} // Version Information type @@ -292,12 +304,15 @@ type var { in case of additions, don't forget to update initialization section! } + {$IFNDEF WINSCP} IsWin95: Boolean = False; IsWin95OSR2: Boolean = False; IsWin98: Boolean = False; IsWin98SE: Boolean = False; IsWinME: Boolean = False; + {$ENDIF} IsWinNT: Boolean = False; + {$IFNDEF WINSCP} IsWinNT3: Boolean = False; IsWinNT31: Boolean = False; IsWinNT35: Boolean = False; @@ -324,6 +339,7 @@ var IsWinServer2022: Boolean = False; IsWinServer: Boolean = False; IsWin11: Boolean = False; + {$ENDIF} const PROCESSOR_ARCHITECTURE_INTEL = 0; @@ -338,6 +354,7 @@ const const Windows11InitialBuildNumber = 22000; +{$IFNDEF WINSCP} function GetWindowsVersion: TWindowsVersion; function GetWindowsEdition: TWindowsEdition; function NtProductType: TNtProductType; @@ -347,11 +364,13 @@ function GetWindowsProductString: string; function GetWindowsProductName: string; function NtProductTypeString: string; function GetWindowsBuildNumber: Integer; +{$ENDIF WINSCP} function GetWindowsMajorVersionNumber: Integer; function GetWindowsMinorVersionNumber: Integer; function GetWindowsVersionNumber: string; function GetWindowsServicePackVersion: Integer; function GetWindowsServicePackVersionString: string; +{$IFNDEF WINSCP} function GetWindowsDisplayVersion: string; function GetWindowsReleaseId: Integer; function GetWindowsReleaseName: String; @@ -366,7 +385,6 @@ function GetWindows10ReleaseVersion: String; {$IFDEF SUPPORTS_DEPRECATED}depreca function GetWindowsServerDisplayVersion: string; {$IFDEF SUPPORTS_DEPRECATED}deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS}'Use GetWindowsDisplayVersion'{$ENDIF};{$ENDIF} function GetWindowsServerReleaseId: Integer; {$IFDEF SUPPORTS_DEPRECATED}deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS}'Use GetWindowsReleaseId'{$ENDIF};{$ENDIF} function GetWindowsServerReleaseVersion: String; {$IFDEF SUPPORTS_DEPRECATED}deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS}'Use GetWindowsReleaseVersion'{$ENDIF};{$ENDIF} -{$IFNDEF WINSCP} function GetOpenGLVersion(const Win: THandle; out Version, Vendor: AnsiString): Boolean; {$ENDIF ~WINSCP} function GetNativeSystemInfo(var SystemInfo: TSystemInfo): Boolean; @@ -375,7 +393,9 @@ function IsWindows64: Boolean; function JclCheckWinVersion(Major, Minor: Integer): Boolean; {$ENDIF MSWINDOWS} +{$IFNDEF WINSCP} function GetOSVersionString: string; +{$ENDIF} // Hardware {$IFDEF MSWINDOWS} @@ -1492,7 +1512,7 @@ uses {$ENDIF MSWINDOWS} {$ENDIF ~HAS_UNITSCOPE} {$IFNDEF WINSCP}Jcl8087, JclIniFiles,{$ENDIF ~WINSCP} - JclSysUtils, JclFileUtils, {$IFNDEF WINSCP}JclAnsiStrings,{$ENDIF ~WINSCP} JclStrings; + JclSysUtils, JclFileUtils, JclAnsiStrings, JclStrings; {$IFDEF WINSCP} @@ -1559,6 +1579,8 @@ end; {$ENDIF MSWINDOWS} {.$ENDIF FPC} +{$IFNDEF WINSCP} + //=== Registry helpers ======================================================= const @@ -1619,6 +1641,8 @@ begin Result := RegReadHklmKeyIntegerValue(HKLM_CURRENT_VERSION_NT, Name, Def, ForceNative); end; +{$ENDIF WINSCP} + //=== Environment ============================================================ function DelEnvironmentVar(const Name: string): Boolean; @@ -1966,7 +1990,6 @@ begin end; SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, LPARAM(PChar(cEnvironment))); end; -{$ENDIF ~WINSCP} //=== Common Folders ========================================================= @@ -1979,6 +2002,8 @@ begin 'CommonFilesDir', ''); end; +{$ENDIF ~WINSCP} + {$ENDIF MSWINDOWS} function GetCurrentFolder: string; @@ -2023,6 +2048,7 @@ end; {$ENDIF MSWINDOWS} {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} { TODO : Check for documented solution } function GetProgramFilesFolder: string; begin @@ -2030,6 +2056,7 @@ begin // as we want the platform (x86/x64) specific common folder. Result := RegReadStringDef(HKEY_LOCAL_MACHINE, HKLM_CURRENT_VERSION_WINDOWS, 'ProgramFilesDir', ''); end; +{$ENDIF WINSCP} { TODO : Check for documented solution } function GetWindowsFolder: string; @@ -2516,6 +2543,7 @@ end; {$ENDIF MSWINDOWS} {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} function GetRegisteredCompany: string; begin { TODO : check for MSDN documentation } @@ -2542,6 +2570,7 @@ begin else Result := ReadWindowsCurrentVersionStringValue('ProductId', '', True); end; +{$ENDIF WINSCP} { TODO: Check supported platforms, maybe complete rewrite } @@ -2823,6 +2852,7 @@ end; {$IFDEF MSWINDOWS} +{$IFNDEF WINSCP} function RunningProcessesList(const List: TStrings; FullPath: Boolean): Boolean; // This function always returns an empty string on Win9x @@ -2954,6 +2984,7 @@ begin List.EndUpdate; end; end; +{$ENDIF WINSCP} { TODO Windows 9x ? } @@ -3397,6 +3428,7 @@ begin Result := taError; end; +{$IFNDEF WINSCP} function GetProcessNameFromWnd(Wnd: THandle): string; var List: TStringList; @@ -3464,6 +3496,7 @@ begin List.Free; end; end; +{$ENDIF} type PSearch = ^TSearch; @@ -3538,6 +3571,7 @@ begin Result := EnumWndStruct.ResultWnd; end; +{$IFNDEF WINSCP} function GetShellProcessName: string; const cShellKey = HKLM_CURRENT_VERSION_NT + '\WinLogon'; @@ -3548,9 +3582,8 @@ const begin if IsWinNT then Result := RegReadStringDef(HKEY_LOCAL_MACHINE, cShellKey, cShellValue, '') -{$IFNDEF WINSCP} else - Result := IniReadString(PathAddSeparator(GetWindowsFolder) + cShellSystemIniFileName, cShellBootSection, cShellValue){$ENDIF ~WINSCP}; + Result := IniReadString(PathAddSeparator(GetWindowsFolder) + cShellSystemIniFileName, cShellBootSection, cShellValue); if Result = '' then Result := cShellDefault; end; @@ -4234,10 +4267,13 @@ begin else Result := Win32BuildNumber; end; +{$ENDIF WINSCP} function GetWindowsMajorVersionNumber: Integer; +{$IFNDEF WINSCP} var Ver: string; +{$ENDIF WINSCP} begin {$IFNDEF WINSCP} // WINSCP: We have the manifest @@ -4256,13 +4292,15 @@ begin end; end else -{$ENDIF} +{$ENDIF WINSCP} Result := Win32MajorVersion; end; function GetWindowsMinorVersionNumber: Integer; +{$IFNDEF WINSCP} var Ver: string; +{$ENDIF WINSCP} begin {$IFNDEF WINSCP} // WINSCP: We have the manifest @@ -4281,7 +4319,7 @@ begin end; end else -{$ENDIF} +{$ENDIF WINSCP} Result := Win32MinorVersion; end; @@ -4328,6 +4366,7 @@ begin Result := ''; end; +{$IFNDEF WINSCP} function GetWindowsDisplayVersion: string; begin // Starting with Windows 10 20H2, the DisplayVersion registry entry is being populated ("20H2") @@ -4562,7 +4601,6 @@ begin Result := ''; end; -{$IFNDEF WINSCP} // Imports copied from OpenGL unit. Direct using of OpenGL unit might cause unexpected problems due // setting 8087CW in the intialization section { @@ -4832,6 +4870,7 @@ end; {$ENDIF MSWINDOWS} +{$IFNDEF WINSCP} function GetOSVersionString: string; {$IFDEF UNIX} var @@ -4846,6 +4885,7 @@ begin Result := Format('%s %s', [GetWindowsVersionString, GetWindowsServicePackVersionString]); end; {$ENDIF MSWINDOWS} +{$ENDIF} //=== Hardware =============================================================== @@ -6603,8 +6643,10 @@ end; procedure InitSysInfo; var SystemInfo: TSystemInfo; + {$IFNDEF WINSCP} Kernel32FileName: string; VerFixedFileInfo: TVSFixedFileInfo; + {$ENDIF} begin { processor information related initialization } @@ -6618,6 +6660,7 @@ begin IsWinNT := Win32Platform = VER_PLATFORM_WIN32_NT; + {$IFNDEF WINSCP} Kernel32FileName := GetModulePath(GetModuleHandle(kernel32)); VerFixedFileInfo.dwFileDateLS := 0; if (not IsWinNT) and VersionFixedFileInfo(Kernel32FileName, VerFixedFileInfo) then @@ -6699,6 +6742,7 @@ begin wvWin11: IsWin11 := True; end; + {$ENDIF} end; procedure FinalizeSysInfo; diff --git a/source/packages/jcl/JclTD32.pas b/source/packages/jcl/JclTD32.pas index 2f419fa83..3ce0849b7 100644 --- a/source/packages/jcl/JclTD32.pas +++ b/source/packages/jcl/JclTD32.pas @@ -877,7 +877,7 @@ const implementation uses - JclResources, JclSysUtils, JclStringConversions; + JclResources, JclSysUtils{$IFNDEF WINSCP}, JclStringConversions{$ENDIF}; {$IFDEF BORLAND} const