microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.13k stars 473 forks source link

GetFileVersionInfoSizeW should return Result #3088

Closed sevenc-nanashi closed 1 month ago

sevenc-nanashi commented 1 month ago

Suggestion

This function might fail according to the documentation:

If the function fails, the return value is zero. To get extended error information, call GetLastError. https://learn.microsoft.com/en-us/windows/win32/api/winver/nf-winver-getfileversioninfosizew

It should return Result<u32>.

riverar commented 1 month ago

I think you meant to quote this 🙂

If the function succeeds, the return value is the size, in bytes, of the file's version information.

riverar commented 1 month ago

Looks like this was already fixed upstream (https://github.com/microsoft/win32metadata/commit/424d1fe948e401471886052bed798a50785312da); we haven't brought in the latest metadata yet due to some unrelated issues, but we'll get it in as soon as possible.

Closing for now as there's nothing to do, but feel free to keep the discussion going if needed.