Skip to content

refactor(ffi): annotate Diplomat getters, setters and disposable types - #538

Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
ffi/authenticode-borrow-program-namefrom
ffi/diplomat-bridge-attrs
Open

irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
ffi/authenticode-borrow-program-namefrom
ffi/diplomat-bridge-attrs

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds the #[diplomat::attr(...)] markers the new Diplomat in #536 needs, so that PR only has the actual migration:

  • 174 getter/setter names. The HIR backend doesn't turn get_/set_ prefixes into properties anymore, so each name here should match the property already in Generated/.
  • 95 manually_disposable, so those types stay IDisposable once it's opt-in.
  • a comment on the 3 opaques that can't opt in (AlgorithmIdentifier, AuthenticodeSignature, Extension), they hand out views borrowing from self.

The Diplomat we pin today drops these attrs, so there's no generated diff. I checked by regenerating with the pinned tool. Heads up, that tool can't regenerate master as-is: its syn chokes on #[unsafe(no_mangle)], so I swapped in #[no_mangle] locally for the check.

Tested: clippy clean, Devolutions.Picky.Tests 26/26 locally.

Adds the `#[diplomat::attr(...)]` markers the next Diplomat needs:

- 174 getter/setter names, since it no longer turns `get_`/`set_`
  prefixes into C# properties
- 95 `manually_disposable` opt-ins, so those types stay `IDisposable`
- a comment on the 3 opaque types that can't opt in

The Diplomat pinned today drops these attributes, so the generated C#
doesn't change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant