Skip to content

Commit

Permalink
[release/6.0] Fix System.Management wminet_utils.dll lookup code for …
Browse files Browse the repository at this point in the history
…arm64 (#83546)

* Fix System.Management wminet_utils.dll lookup code for arm64

* Update ManagementScope.cs

* Update System.Management.csproj

* Update Microsoft.Windows.Compatibility.csproj

* Add missing assembly reference.

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 17, 2023
1 parent 43bb599 commit 32c3904
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<!-- Reference the outputs for the dependency nodes calculation. -->
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>3</ServicingVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>4</ServicingVersion>
<!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription>
Expand Down
5 changes: 3 additions & 2 deletions src/libraries/System.Management/src/System.Management.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<!-- If you enable GeneratePackageOnBuild for this package and bump ServicingVersion, make sure to also bump ServicingVersion in Microsoft.Windows.Compatibility.csproj once for the next release. -->
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>0</ServicingVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
<PackageDescription>Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.
Expand Down Expand Up @@ -80,6 +80,7 @@ System.Management.SelectQuery</PackageDescription>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Threading.ThreadPool" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ 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)
{
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 32c3904

Please sign in to comment.