Skip to content

Commit

Permalink
Fix System.Management wminet_utils.dll lookup code for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer committed Mar 16, 2023
1 parent 5bdc36e commit 2a6b0f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ internal enum APTTYPE
static WmiNetUtilsHelper()
{
RegistryKey netFrameworkSubKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework\");
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue("InstallRoot");

string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue(RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ?
"InstallRootArm64" :
"InstallRoot");

if (netFrameworkInstallRoot == null)
{
// In some Windows versions, like Nano Server, the .NET Framework is not installed by default.
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Management/tests/WmiTestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class WmiTestHelper
private static readonly bool s_isElevated = AdminHelpers.IsProcessElevated();
private static readonly bool s_isWmiSupported =
PlatformDetection.IsWindows &&
PlatformDetection.IsNotArmNorArm64Process &&
PlatformDetection.IsNotArmProcess &&
PlatformDetection.IsNotWindowsNanoServer &&
PlatformDetection.IsNotWindowsIoTCore &&
!PlatformDetection.IsInAppContainer;
Expand Down

0 comments on commit 2a6b0f4

Please sign in to comment.