Repository navigation
Closed
Labels
Milestone
Description
Description
System.Management requires wminet_utils.dll in order to perform must of it's functionality, however this component is missing on some SKUs / architectures of Windows which do not include .NETFramework (eg: ARM64, and others)
runtime/src/libraries/System.Management/src/System/Management/ManagementScope.cs
Lines 308 to 378 in 4486164
| string wminet_utilsPath = Path.Combine( | |
| netFrameworkInstallRoot, | |
| CompatSwitches.DotNetVersion, // The same value is hard coded on Environment.Version and quirks for WMI | |
| "wminet_utils.dll"); | |
| IntPtr hModule = Interop.Kernel32.LoadLibrary(wminet_utilsPath); | |
| if (hModule == IntPtr.Zero) | |
| { | |
| // This is unlikely, so having the TypeInitializationException wrapping it is fine. | |
| throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Format(SR.LoadLibraryFailed, wminet_utilsPath)); | |
| } | |
| if (LoadDelegate(ref ResetSecurity_f, hModule, "ResetSecurity") && | |
| LoadDelegate(ref SetSecurity_f, hModule, "SetSecurity") && | |
| LoadDelegate(ref BlessIWbemServices_f, hModule, "BlessIWbemServices") && | |
| LoadDelegate(ref BlessIWbemServicesObject_f, hModule, "BlessIWbemServicesObject") && | |
| LoadDelegate(ref GetPropertyHandle_f27, hModule, "GetPropertyHandle") && | |
| LoadDelegate(ref WritePropertyValue_f28, hModule, "WritePropertyValue") && | |
| LoadDelegate(ref Clone_f12, hModule, "Clone") && | |
| LoadDelegate(ref VerifyClientKey_f, hModule, "VerifyClientKey") && | |
| LoadDelegate(ref GetQualifierSet_f, hModule, "GetQualifierSet") && | |
| LoadDelegate(ref Get_f, hModule, "Get") && | |
| LoadDelegate(ref Put_f, hModule, "Put") && | |
| LoadDelegate(ref Delete_f, hModule, "Delete") && | |
| LoadDelegate(ref GetNames_f, hModule, "GetNames") && | |
| LoadDelegate(ref BeginEnumeration_f, hModule, "BeginEnumeration") && | |
| LoadDelegate(ref Next_f, hModule, "Next") && | |
| LoadDelegate(ref EndEnumeration_f, hModule, "EndEnumeration") && | |
| LoadDelegate(ref GetPropertyQualifierSet_f, hModule, "GetPropertyQualifierSet") && | |
| LoadDelegate(ref Clone_f, hModule, "Clone") && | |
| LoadDelegate(ref GetObjectText_f, hModule, "GetObjectText") && | |
| LoadDelegate(ref SpawnDerivedClass_f, hModule, "SpawnDerivedClass") && | |
| LoadDelegate(ref SpawnInstance_f, hModule, "SpawnInstance") && | |
| LoadDelegate(ref CompareTo_f, hModule, "CompareTo") && | |
| LoadDelegate(ref GetPropertyOrigin_f, hModule, "GetPropertyOrigin") && | |
| LoadDelegate(ref InheritsFrom_f, hModule, "InheritsFrom") && | |
| LoadDelegate(ref GetMethod_f, hModule, "GetMethod") && | |
| LoadDelegate(ref PutMethod_f, hModule, "PutMethod") && | |
| LoadDelegate(ref DeleteMethod_f, hModule, "DeleteMethod") && | |
| LoadDelegate(ref BeginMethodEnumeration_f, hModule, "BeginMethodEnumeration") && | |
| LoadDelegate(ref NextMethod_f, hModule, "NextMethod") && | |
| LoadDelegate(ref EndMethodEnumeration_f, hModule, "EndMethodEnumeration") && | |
| LoadDelegate(ref GetMethodQualifierSet_f, hModule, "GetMethodQualifierSet") && | |
| LoadDelegate(ref GetMethodOrigin_f, hModule, "GetMethodOrigin") && | |
| LoadDelegate(ref QualifierGet_f, hModule, "QualifierSet_Get") && | |
| LoadDelegate(ref QualifierPut_f, hModule, "QualifierSet_Put") && | |
| LoadDelegate(ref QualifierDelete_f, hModule, "QualifierSet_Delete") && | |
| LoadDelegate(ref QualifierGetNames_f, hModule, "QualifierSet_GetNames") && | |
| LoadDelegate(ref QualifierBeginEnumeration_f, hModule, "QualifierSet_BeginEnumeration") && | |
| LoadDelegate(ref QualifierNext_f, hModule, "QualifierSet_Next") && | |
| LoadDelegate(ref QualifierEndEnumeration_f, hModule, "QualifierSet_EndEnumeration") && | |
| LoadDelegate(ref GetCurrentApartmentType_f, hModule, "GetCurrentApartmentType") && | |
| LoadDelegate(ref GetDemultiplexedStub_f, hModule, "GetDemultiplexedStub") && | |
| LoadDelegate(ref CreateInstanceEnumWmi_f, hModule, "CreateInstanceEnumWmi") && | |
| LoadDelegate(ref CreateClassEnumWmi_f, hModule, "CreateClassEnumWmi") && | |
| LoadDelegate(ref ExecQueryWmi_f, hModule, "ExecQueryWmi") && | |
| LoadDelegate(ref ExecNotificationQueryWmi_f, hModule, "ExecNotificationQueryWmi") && | |
| LoadDelegate(ref PutInstanceWmi_f, hModule, "PutInstanceWmi") && | |
| LoadDelegate(ref PutClassWmi_f, hModule, "PutClassWmi") && | |
| LoadDelegate(ref CloneEnumWbemClassObject_f, hModule, "CloneEnumWbemClassObject") && | |
| LoadDelegate(ref ConnectServerWmi_f, hModule, "ConnectServerWmi") && | |
| LoadDelegate(ref GetErrorInfo_f, hModule, "GetErrorInfo") && | |
| LoadDelegate(ref Initialize_f, hModule, "Initialize")) | |
| { | |
| // All required delegates were loaded. | |
| Initialize_f(CompatSwitches.AllowIManagementObjectQI); | |
| } | |
| else | |
| { | |
| LoadPlatformNotSupportedDelegates(SR.Format(SR.PlatformNotSupported_FrameworkUpdatedRequired, wminet_utilsPath)); | |
| } |
Activity
ericstj commentedon Nov 24, 2020
Note that the original authors of this component recommend MMI as a replacement: #24803 (comment)
The latest version of this package does support ARM64:
https://www.nuget.org/packages/Microsoft.Management.Infrastructure/
@SteveL-MSFT do you know of anyone porting from System.Management to MMI: is it straight forward?
danmoseley commentedon Dec 2, 2020
For non ARM64 - I assume you mean Windows Nano? I don't think we've gotten feedback on that gap so I guess ARM64 is the interesting case.
danmoseley commentedon Jun 8, 2021
@ericstj should we close this, or at least it should move out of 6.0
ericstj commentedon Jun 8, 2021
Agreed on moving to future.
danmoseley commentedon Aug 5, 2021
I'm going to close this as there's no longer a partner ask and it's a legacy tech.