Skip to content

Commit

Permalink
Suppress warnings for CA1416 (#2762)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft committed Dec 14, 2022
1 parent 050056a commit 9173869
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ protected override void ProcessRecord()
}

/// <inheritdoc />
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Targets Windows 10.0.17763.0")]
protected override InstallOptions GetInstallOptions(PackageVersionId version)
{
InstallOptions options = base.GetInstallOptions(version);
Expand Down
2 changes: 2 additions & 0 deletions src/PowerShell/Microsoft.WinGet.Client/Common/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static ResourceManager ResourceManager
/// <summary>
/// Gets a value indicating whether the current assembly is executing in an administrative context.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only API")]
public static bool ExecutingAsAdministrator
{
get
Expand All @@ -41,6 +42,7 @@ public static bool ExecutingAsAdministrator
/// <summary>
/// Gets a value indicating whether the current assembly is executing as a SYSTEM user.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only API")]
public static bool ExecutingAsSystem
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ public class ComObjectFactory
private static readonly Guid UninstallOptionsClsid = Guid.Parse("AA2A5C04-1AD9-46C4-B74F-6B334AD7EB8C");
private static readonly Guid PackageMatchFilterClsid = Guid.Parse("3F85B9F4-487A-4C48-9035-2903F8A6D9E8");
#endif

[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type PackageManagerType = Type.GetTypeFromCLSID(PackageManagerClsid);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type FindPackagesOptionsType = Type.GetTypeFromCLSID(FindPackagesOptionsClsid);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type CreateCompositePackageCatalogOptionsType = Type.GetTypeFromCLSID(CreateCompositePackageCatalogOptionsClsid);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type InstallOptionsType = Type.GetTypeFromCLSID(InstallOptionsClsid);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type UninstallOptionsType = Type.GetTypeFromCLSID(UninstallOptionsClsid);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "COM only usage.")]
private static readonly Type PackageMatchFilterType = Type.GetTypeFromCLSID(PackageMatchFilterClsid);

private static readonly Guid PackageManagerIid = Guid.Parse("B375E3B9-F2E0-5C93-87A7-B67497F7E593");
Expand Down

0 comments on commit 9173869

Please sign in to comment.