@@ -21,7 +21,7 @@ public static PlatformInformation GetPlatformInformation()
21
21
return new PlatformInformation ( osType , osVersion , cpuArch , clrVersion ) ;
22
22
}
23
23
24
- public static bool IsWindows10OrGreater ( )
24
+ public static bool IsWindowsBrokerSupported ( )
25
25
{
26
26
if ( ! IsWindows ( ) )
27
27
{
@@ -38,7 +38,27 @@ public static bool IsWindows10OrGreater()
38
38
return false ;
39
39
}
40
40
41
- return ( int ) osvi . dwMajorVersion >= 10 ;
41
+ // Windows major version 10 is required for WAM
42
+ if ( osvi . dwMajorVersion < 10 )
43
+ {
44
+ return false ;
45
+ }
46
+
47
+ // Specific minimum build number is different between Windows Server and Client SKUs
48
+ const int minClientBuildNumber = 15063 ;
49
+ const int minServerBuildNumber = 17763 ; // Server 2019
50
+
51
+ switch ( osvi . wProductType )
52
+ {
53
+ case VER_NT_WORKSTATION :
54
+ return osvi . dwBuildNumber >= minClientBuildNumber ;
55
+
56
+ case VER_NT_SERVER :
57
+ case VER_NT_DOMAIN_CONTROLLER :
58
+ return osvi . dwBuildNumber >= minServerBuildNumber ;
59
+ }
60
+
61
+ return false ;
42
62
}
43
63
44
64
/// <summary>
@@ -283,8 +303,31 @@ private unsafe struct RTL_OSVERSIONINFOEX
283
303
internal uint dwBuildNumber ;
284
304
internal uint dwPlatformId ;
285
305
internal fixed char szCSDVersion [ 128 ] ;
306
+ internal ushort wServicePackMajor ;
307
+ internal ushort wServicePackMinor ;
308
+ internal short wSuiteMask ;
309
+ internal byte wProductType ;
310
+ internal byte wReserved ;
286
311
}
287
312
313
+ /// <summary>
314
+ /// The operating system is Windows client.
315
+ /// </summary>
316
+ private const byte VER_NT_WORKSTATION = 0x0000001 ;
317
+
318
+ /// <summary>
319
+ /// The system is a domain controller and the operating system is Windows Server.
320
+ /// </summary>
321
+ private const byte VER_NT_DOMAIN_CONTROLLER = 0x0000002 ;
322
+
323
+ /// <summary>
324
+ /// The operating system is Windows Server.
325
+ /// </summary>
326
+ /// <remarks>
327
+ /// A server that is also a domain controller is reported as VER_NT_DOMAIN_CONTROLLER, not VER_NT_SERVER.
328
+ /// </remarks>
329
+ private const byte VER_NT_SERVER = 0x0000003 ;
330
+
288
331
#endregion
289
332
}
290
333
0 commit comments