Skip to content

Conversation

@nicoburns
Copy link
Collaborator

@nicoburns nicoburns commented Jan 16, 2026

Upgrades the windows and windows-core crates to the latest 0.62 versions

Signed-off-by: Nico Burns <nico@nicoburns.com>
numbersubstitution: *mut Option<IDWriteNumberSubstitution>,
numbersubstitution: OutRef<'_, IDWriteNumberSubstitution>,
) -> windows::core::Result<()> {
numbersubstitution.write(None)?;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure this is the correct way to translate this into the new API

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked a bit into this and I think the answer is yes, this is the way. However, the surrounding context seems quite arcane.

The COM memory management rules state that all out pointer parameters (including pointer members of a caller-allocate callee-fill structure) must explicitly be set to NULL. This is what the old code was presumably doing with None and this new write call replicates that.

I do find it scary that "safe" Rust code can be written so easily that results in uninitialized memory being read by the OS. I did not find any signs that windows adds any safety for this purpose, but it's possible I missed it. I did find various flavors of the following statement: metadata doesn't currently include information about which fields require automatic initialization. Meaning that the bindgen just doesn't know which parameters need extra safety vs. where it would ruin things.

It's not just the lack of well structured metadata either. Human readable docs are quite limited. GetNumberSubstitution docs have little content with no info about safety. The Rust bindings (1, 2) have literally zero documentation.

A few relevant links to this specific change:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I also looked for docs on this and struggled to find any.

@nicoburns nicoburns marked this pull request as ready for review January 17, 2026 00:38
@nicoburns nicoburns added this pull request to the merge queue Jan 18, 2026
Merged via the queue into linebender:main with commit eedf122 Jan 18, 2026
24 checks passed
@nicoburns nicoburns deleted the windows062 branch January 18, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants