From f2788f2e09b99bb53af211096a280fb96222fdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pol=C3=A1=C5=A1ek?= Date: Fri, 27 Feb 2026 19:58:54 +0100 Subject: [PATCH] CmdPal: Supress CsWinRT1028 on source generated interop types (#45827) ## Summary of the Pull Request This PR add local suppression of CsWinRT1028 (not marked partial) for `Windows.Win32.UnhookWinEventSafeHandle` and `Windows.Win32.DeleteObjectSafeHandle` ## PR Checklist - [x] Related to: #42574 - [ ] Closes: #xxx - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- src/modules/cmdpal/Microsoft.CmdPal.UI/LocalSuppressions.cs | 1 + .../cmdpal/ext/Microsoft.CmdPal.Ext.Apps/LocalSuppressions.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/LocalSuppressions.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI/LocalSuppressions.cs index c466c4b304..86262e16e2 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/LocalSuppressions.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/LocalSuppressions.cs @@ -8,3 +8,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.FreeLibrarySafeHandle")] [assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.UnhookWindowsHookExSafeHandle")] [assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.DeleteObjectSafeHandle")] +[assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.UnhookWinEventSafeHandle")] diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/LocalSuppressions.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/LocalSuppressions.cs index 87a0cf5673..d53a63a61e 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/LocalSuppressions.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/LocalSuppressions.cs @@ -4,3 +4,4 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.SysFreeStringSafeHandle")] +[assembly: SuppressMessage("Interoperability", "CsWinRT1028: Class should be marked partial", Justification = "CsWin32 generated code; not used across WinRT boundary", Scope = "type", Target = "~T:Windows.Win32.DeleteObjectSafeHandle")]