Skip to content

Commit c1b073f

Browse files
committed
Update 3rd party PJSysInfo to v5.8.0
Fixes #43
1 parent a4c927f commit c1b073f

File tree

1 file changed

+63
-99
lines changed

1 file changed

+63
-99
lines changed

Src/3rdParty/PJSysInfo.pas

Lines changed: 63 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
* This Source Code Form is subject to the terms of the Mozilla Public License,
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
4-
* obtain one at https://mozilla.org/MPL/2.0/
4+
* obtain one at http://mozilla.org/MPL/2.0/
55
*
66
* Copyright (C) 2001-2021, Peter Johnson (@delphidabbler).
77
*
8-
* $Rev: 2079 $
9-
* $Date: 2021-11-27 14:29:47 +0000 (Sat, 27 Nov 2021) $
8+
* $Rev: 2082 $
9+
* $Date: 2022-01-01 10:12:03 +0000 (Sat, 01 Jan 2022) $
1010
*
1111
* This unit contains various static classes, constants, type definitions and
1212
* global variables for use in providing information about the host computer and
@@ -1247,6 +1247,18 @@ implementation
12471247
// - 10.0.22463.1000 (RSPRERELEASE)
12481248
Win11v21H2PreRel5Build = 22468; // Windows 11 version 21H2
12491249
// - 10.0.22468.1000 (RSPRERELEASE)
1250+
Win11v21H2PreRel6Build = 22471; // Windows 11 version 21H2
1251+
// - 10.0.22471.1000 (RSPRERELEASE)
1252+
Win11v21H2PreRel7Build = 22478; // Windows 11 version 21H2
1253+
// - 10.0.22478.1000 (RSPRERELEASE)
1254+
Win11v21H2PreRel8Build = 22483; // Windows 11 version 21H2
1255+
// - 10.0.22483.1000 (RSPRERELEASE)
1256+
Win11v21H2PreRel9Build = 22489; // Windows 11 version 21H2
1257+
// - 10.0.22489.1000 (RSPRERELEASE)
1258+
Win11v21H2PreRel10Build = 22494;// Windows 11 version 21H2
1259+
// - 10.0.22494.1000 (RSPRERELEASE)
1260+
Win11v21H2PreRel11Build = 22509;// Windows 11 version 21H2
1261+
// - 10.0.22509.1000 (RSPRERELEASE)
12501262

12511263
Win11FirstBuild = Win11DevBuild; // First build number of Windows 11
12521264

@@ -1398,6 +1410,28 @@ function IsBuildNumber(BuildNumber: DWORD): Boolean;
13981410
Result := VerifyVersionInfo(POSVI, VER_BUILDNUMBER, ConditionalMask);
13991411
end;
14001412

1413+
// Checks if any of the given build numbers match that of the current OS.
1414+
// If current build number is in the list, FoundBN is set to the found build
1415+
// number and True is returned. Otherwise False is returned and FoundBN is set
1416+
// to zero.
1417+
function FindBuildNumberFrom(const BNs: array of Integer; var FoundBN: Integer):
1418+
Boolean;
1419+
var
1420+
I: Integer;
1421+
begin
1422+
FoundBN := 0;
1423+
Result := False;
1424+
for I := Low(BNs) to High(BNs) do
1425+
begin
1426+
if IsBuildNumber(BNs[I]) then
1427+
begin
1428+
FoundBN := BNs[I];
1429+
Result := True;
1430+
Break;
1431+
end;
1432+
end;
1433+
end;
1434+
14011435
// Checks if the OS has the given product type.
14021436
// Assumes VerifyVersionInfo & VerSetConditionMask APIs functions are available
14031437
function IsWindowsProductType(ProductType: Byte): Boolean;
@@ -1631,13 +1665,6 @@ procedure InitPlatformIdEx;
16311665
GetProductInfo: TGetProductInfo; // pointer to GetProductInfo API function
16321666
SI: TSystemInfo; // structure from GetSystemInfo API call
16331667

1634-
// Return name of Windows Server 2019 insider preview release for given build
1635-
// number. Build must be a valid insider preview release number
1636-
function Win2019IPExtra(const Build: Integer): string;
1637-
begin
1638-
Result := Format('Insider Preview Build %d', [Build]);
1639-
end;
1640-
16411668
// Get OS's revision number from registry.
16421669
function GetOSRevisionNumber(const IsNT: Boolean): Integer;
16431670
begin
@@ -1824,8 +1851,8 @@ procedure InitPlatformIdEx;
18241851
// release of Win 11 -- well hidden eh?!
18251852
InternalBuildNumber := Win11v21H2Build;
18261853
case InternalBuildNumber of
1827-
194:
1828-
// First public release of Windows 11
1854+
194..MaxInt:
1855+
// Public releases of Windows 11 have build number >= 194
18291856
InternalExtraUpdateInfo := 'Version 21H2';
18301857
51, 65, 71, 100, 120, 132, 168:
18311858
InternalExtraUpdateInfo := Format(
@@ -1844,41 +1871,18 @@ procedure InitPlatformIdEx;
18441871
);
18451872
end;
18461873
end
1847-
else if IsBuildNumber(Win11v21H2PreRel1Build) then
1848-
begin
1849-
InternalBuildNumber := Win11v21H2PreRel1Build;
1850-
InternalExtraUpdateInfo := Format(
1851-
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1852-
[InternalBuildNumber, InternalRevisionNumber]
1853-
);
1854-
end
1855-
else if IsBuildNumber(Win11v21H2PreRel2Build) then
1856-
begin
1857-
InternalBuildNumber := Win11v21H2PreRel2Build;
1858-
InternalExtraUpdateInfo := Format(
1859-
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1860-
[InternalBuildNumber, InternalRevisionNumber]
1861-
);
1862-
end
1863-
else if IsBuildNumber(Win11v21H2PreRel3Build) then
1864-
begin
1865-
InternalBuildNumber := Win11v21H2PreRel3Build;
1866-
InternalExtraUpdateInfo := Format(
1867-
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1868-
[InternalBuildNumber, InternalRevisionNumber]
1869-
);
1870-
end
1871-
else if IsBuildNumber(Win11v21H2PreRel4Build) then
1872-
begin
1873-
InternalBuildNumber := Win11v21H2PreRel4Build;
1874-
InternalExtraUpdateInfo := Format(
1875-
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1876-
[InternalBuildNumber, InternalRevisionNumber]
1877-
);
1878-
end
1879-
else if IsBuildNumber(Win11v21H2PreRel5Build) then
1874+
else if FindBuildNumberFrom(
1875+
[
1876+
Win11v21H2PreRel1Build, Win11v21H2PreRel2Build,
1877+
Win11v21H2PreRel3Build, Win11v21H2PreRel4Build,
1878+
Win11v21H2PreRel5Build, Win11v21H2PreRel6Build,
1879+
Win11v21H2PreRel7Build, Win11v21H2PreRel8Build,
1880+
Win11v21H2PreRel9Build, Win11v21H2PreRel10Build,
1881+
Win11v21H2PreRel11Build
1882+
],
1883+
InternalBuildNumber
1884+
) then
18801885
begin
1881-
InternalBuildNumber := Win11v21H2PreRel5Build;
18821886
InternalExtraUpdateInfo := Format(
18831887
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
18841888
[InternalBuildNumber, InternalRevisionNumber]
@@ -1925,60 +1929,20 @@ procedure InitPlatformIdEx;
19251929
InternalBuildNumber := Win2016v1803Build;
19261930
InternalExtraUpdateInfo := 'Version 1803';
19271931
end
1928-
else if IsBuildNumber(Win2019IP180320Build) then
1929-
begin
1930-
InternalBuildNumber := Win2019IP180320Build;
1931-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180320Build);
1932-
end
1933-
else if IsBuildNumber(Win2019IP180324Build) then
1934-
begin
1935-
InternalBuildNumber := Win2019IP180324Build;
1936-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180324Build);
1937-
end
1938-
else if IsBuildNumber(Win2019IP180515Build) then
1939-
begin
1940-
InternalBuildNumber := Win2019IP180515Build;
1941-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180515Build);
1942-
end
1943-
else if IsBuildNumber(Win2019IP180619Build) then
1944-
begin
1945-
InternalBuildNumber := Win2019IP180619Build;
1946-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180619Build);
1947-
end
1948-
else if IsBuildNumber(Win2019IP180710Build) then
1932+
else if FindBuildNumberFrom(
1933+
[
1934+
Win2019IP180320Build, Win2019IP180324Build,
1935+
Win2019IP180515Build, Win2019IP180619Build,
1936+
Win2019IP180710Build, Win2019IP180716Build,
1937+
Win2019IP180731Build, Win2019IP180814Build,
1938+
Win2019IP180821Build, Win2019IP180828Build
1939+
],
1940+
InternalBuildNumber
1941+
) then
19491942
begin
1950-
InternalBuildNumber := Win2019IP180710Build;
1951-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180710Build);
1952-
end
1953-
else if IsBuildNumber(Win2019IP180716Build) then
1954-
begin
1955-
InternalBuildNumber := Win2019IP180716Build;
1956-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180716Build);
1957-
end
1958-
else if IsBuildNumber(Win2019IP180716Build) then
1959-
begin
1960-
InternalBuildNumber := Win2019IP180716Build;
1961-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180716Build);
1962-
end
1963-
else if IsBuildNumber(Win2019IP180731Build) then
1964-
begin
1965-
InternalBuildNumber := Win2019IP180731Build;
1966-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180731Build);
1967-
end
1968-
else if IsBuildNumber(Win2019IP180814Build) then
1969-
begin
1970-
InternalBuildNumber := Win2019IP180814Build;
1971-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180814Build);
1972-
end
1973-
else if IsBuildNumber(Win2019IP180821Build) then
1974-
begin
1975-
InternalBuildNumber := Win2019IP180821Build;
1976-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180821Build);
1977-
end
1978-
else if IsBuildNumber(Win2019IP180828Build) then
1979-
begin
1980-
InternalBuildNumber := Win2019IP180828Build;
1981-
InternalExtraUpdateInfo := Win2019IPExtra(Win2019IP180828Build);
1943+
InternalExtraUpdateInfo := Format(
1944+
'Insider Preview Build %d', [InternalBuildNumber]
1945+
);
19821946
end
19831947
else if IsBuildNumber(Win2019v1809Build) then
19841948
begin

0 commit comments

Comments
 (0)