You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -228,5 +183,88 @@ public static extern uint D3D11CreateDevice(
228
183
IntPtrimmediateContext
229
184
);
230
185
}
186
+
187
+
/// <summary>
188
+
/// Provides helper methods for retrieving information about the system's operating system, CPUs, and GPUs.
189
+
/// These methods were moved into a non-static class so that an exception thrown and caught would not lead to a fatal System.TypeInitializationException in the constructor of the static SystemInfo class
190
+
/// </summary>
191
+
/// <remarks>This class offers methods to query system hardware and software details using
192
+
/// platform-specific APIs. The information returned by these methods may vary depending on the underlying
193
+
/// operating system and available system permissions. Methods may return partial or default information if
194
+
/// system queries fail or are unsupported on the current platform.</remarks>
195
+
publicclassSystemInfoHelper
196
+
{
197
+
publicPlatformGetOperatingSystem()
198
+
{
199
+
varplatform=newPlatform();
200
+
try
201
+
{
202
+
// Uncomment this throw to prove the exception reported in https://bugs.launchpad.net/or/+bug/2131143 is no longer fatal.
203
+
//throw new ManagementException();
204
+
205
+
// Almost nothing will correctly identify Windows 11 at this point, so we have to use WMI.
0 commit comments