Skip to content

Commit 2579718

Browse files
Merge pull request #76 from microsoft/20240925_UpdateDriverInfo
SQLOLEDB TLS 1.2 support reporting fixes
2 parents f6e6848 + c146812 commit 2579718

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed
0 Bytes
Binary file not shown.

SQLCheck/SQLCheck/Collectors.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public static void CollectComputer(DataSet ds)
175175
DisplayVersion = Utility.RegistryTryGetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DisplayVersion", "");
176176
Computer["WindowsReleaseID"] = releaseID;
177177
if (DisplayVersion == "") DisplayVersion = releaseID; // Windows 2022 uses DisplayVersion, Windows 2019 and earlier do not have this, use ReleaseID instead
178+
Computer["WindowsDisplayVersion"] = DisplayVersion;
178179
ubr = Utility.RegistryTryGetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "UBR", 0); // UBR = Update Build Revision
179180
Computer["WindowsUBR"] = ubr.ToString();
180181

@@ -1460,6 +1461,7 @@ public static void CollectDatabaseDriver(DataSet ds)
14601461
FileVersionInfo versionInfo = null;
14611462
string windowsVersion = Computer.GetString("WindowsVersion");
14621463
string windowsReleaseID = Computer.GetString("WindowsReleaseID");
1464+
string windowsDisplayVersion = Computer.GetString("WindowsDisplayVersion"); // use instead of ReleaseID for GetDriverInfo call
14631465
string badPath = "";
14641466

14651467
foreach (DataRow Provider in OLEDBProviders.Rows)
@@ -1500,7 +1502,8 @@ public static void CollectDatabaseDriver(DataSet ds)
15001502
versionInfo = null;
15011503
DatabaseDriver["Message"] = badPath + "File not found";
15021504
}
1503-
info = DriverInfo.GetDriverInfo(Provider["ProgID"].ToString(), versionInfo, windowsVersion, windowsReleaseID);
1505+
// info = DriverInfo.GetDriverInfo(Provider["ProgID"].ToString(), versionInfo, windowsVersion, windowsReleaseID); // okay for Win 2019 and prior, need display version for 2022 and later
1506+
info = DriverInfo.GetDriverInfo(Provider["ProgID"].ToString(), versionInfo, windowsVersion, windowsDisplayVersion);
15041507
DatabaseDriver["Version"] = versionInfo == null ? "Unknown" : versionInfo.ProductVersion;
15051508
DatabaseDriver["TLS12"] = info == null ? "" : info.MinTLS12Version;
15061509
DatabaseDriver["TLS13"] = info == null ? "" : info.MinTLS13Version;

SQLCheck/SQLCheck/DriverInfo.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public DriverInfo(string driverName, string driverType, string minTLS12Version,
3636
MultiSubnetFailover = multiSubnetFailover;
3737
}
3838

39-
public static DriverInfo GetDriverInfo(string driverName, FileVersionInfo versionInfo, string WindowsVersion, string WindowsReleaseID) // TODO - fix up MinTLSVersion and Server Support
39+
public static DriverInfo GetDriverInfo(string driverName, FileVersionInfo versionInfo, string WindowsVersion, string WindowsDisplayVersion) // TODO - fix up MinTLSVersion and Server Support
4040
{
4141
string TLS12 = "No";
4242
string TLS13 = "No";
@@ -60,7 +60,8 @@ public static DriverInfo GetDriverInfo(string driverName, FileVersionInfo versio
6060
{
6161
case "SQLOLEDB":
6262
case "SQL Server":
63-
switch (WindowsReleaseID.ToUpper())
63+
// switch (WindowsReleaseID.ToUpper()) // okay for pre-Win 11 or Win 2022
64+
switch (WindowsDisplayVersion.ToUpper())
6465
{
6566
case "": // Windows 8.1/2012 R2 and earlier - Won't fix these versions: Windows 2003, XP, 2008, 2008 R2, 2012
6667
// Windows 8.1 and Windows 2012 R2 = version 6.3.9600 - what build supports the updated DBNETLIB.DLL???
@@ -104,11 +105,15 @@ public static DriverInfo GetDriverInfo(string driverName, FileVersionInfo versio
104105
if (Utility.CompareVersion(WindowsVersion, "10.0.19042") == "=" && Utility.CompareVersion(WindowsVersion, "10.0.19042.609") == ">") TLS12 = "Yes";
105106
break;
106107
case "21H1": // Windows 10/2019 21H1 ???? build 19043 ????
108+
case "IRON": // more at https://microsoft.visualstudio.com/OS/_workitems/edit/27324781
109+
case "21H2":
110+
case "22H2":
111+
case "23H2":
112+
case "24H2":
107113
TLS12 = "Yes";
108114
break;
109-
case "IRON": // Windows 10/2019 Iron ???? build 20207???? ???? April 16, 2021????
110-
// more at https://microsoft.visualstudio.com/OS/_workitems/edit/27324781
111-
TLS12 = "Yes";
115+
default: // all versions of Winodws 11 or 2022 or greater support TLS 1.2
116+
if (Utility.CompareVersion(WindowsVersion, "10.0.19999") == ">") TLS12 = "Yes";
112117
break;
113118
}
114119
break;

SQLCheck/SQLCheck/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.1422.0")]
36-
[assembly: AssemblyFileVersion("1.0.1422.0")]
35+
[assembly: AssemblyVersion("1.0.1435.0")]
36+
[assembly: AssemblyFileVersion("1.0.1435.0")]

SQLCheck/SQLCheck/Storage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public static DataSet CreateDataSet(String ComputerName)
140140
dt.AddColumn("MinorVersion", "String");
141141
dt.AddColumn("WindowsBuild", "String");
142142
dt.AddColumn("WindowsReleaseID", "String");
143+
dt.AddColumn("WindowsDisplayVersion", "String"); // in Windows 2022, this is separate from RelaseID, for prior versions, ReleaseID is copied here
143144
dt.AddColumn("WindowsUBR", "String");
144145
dt.AddColumn("CLR4Version", "String");
145146
dt.AddColumn("CLR4StrongCrypto", "String");

0 commit comments

Comments
 (0)