fix(windows-clippy): pf-frame SAFETY comments + checked_div, pf-clipboard SAFETY placement + Gdi feature

Surfaced by giving windows-host CI its missing pf-encode/pf-frame path triggers:
the T2.3 auto-gate (dxgi.rs) and the clipboard host (windows.rs) landed with
Windows clippy owed — three undocumented unsafe blocks, one manual checked
division, one comment orphaned off its statement, and a latent E0432 in
standalone pf-clipboard builds (WNDCLASSW needs Win32_Graphics_Gdi; the host
graph only compiled via feature unification).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 20:08:44 +02:00
parent 9da38b8d9c
commit 0c9d3ee33f
3 changed files with 283 additions and 17 deletions
+1 -1
View File
@@ -226,8 +226,8 @@ impl WinClip {
.format_for_wire(wire)
.context("unsupported wire MIME")?;
// Image fetch with no native "PNG" on the clipboard (most apps): read CF_DIB and convert.
// SAFETY: IsClipboardFormatAvailable has no preconditions and needs no open clipboard.
let mut via_dib = false;
// SAFETY: IsClipboardFormatAvailable has no preconditions and needs no open clipboard.
if wire == WIRE_PNG && unsafe { IsClipboardFormatAvailable(fmt) }.is_err() {
fmt = CF_DIB.0 as u32;
via_dib = true;