Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the return type of volume_serial_number to u32. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunfishcode
Copy link
Contributor

Change the return types of volume_serial_number() and
number_of_links() from u64 to u32. This makes it easier to migrate
code from manually using the underlying Windows APIs with dwVolumeSerialNumber
and nNumberOfLinks, which are u32, to using
winapi_util::file::Information instead.

This also aligns with Rust nightly's windows_by_handle feature,
where the corresponding types are u32.

Change the return types of `volume_serial_number()` and
`number_of_links()` from `u64` to `u32`. This makes it easier to migrate
code from manually using the underlying Windows APIs with `dwVolumeSerialNumber`
and `nNumberOfLinks`, which are `u32`, to using
`winapi_util::file::Information` instead.

This also aligns with Rust nightly's [`windows_by_handle`] feature,
where the [corresponding types are `u32`].

[`windows_by_handle`]: rust-lang/rust#63010
[corresponding types are `u32`]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html#tymethod.volume_serial_number
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Feb 18, 2021
Use `winapi_util::file::information` in place of `winx::file::get_fileinfo`,
which is simpler, except for needing to convert the types, which we need
to do because we're ultimately using these values in the
[windows `MetadataExt` trait] which uses `u32`. I submitted
BurntSushi/winapi-util#7 to propose changing the types upstream.

[windows `MetadataExt` trait]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Feb 18, 2021
Use `winapi_util::file::information` in place of `winx::file::get_fileinfo`,
which is simpler, except for needing to convert the types, which we need
to do because we're ultimately using these values in the
[windows `MetadataExt` trait] which uses `u32`. I submitted
BurntSushi/winapi-util#7 to propose changing the types upstream.

[windows `MetadataExt` trait]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Feb 22, 2021
Use `winapi_util::file::information` in place of `winx::file::get_fileinfo`,
which is simpler, except for needing to convert the types, which we need
to do because we're ultimately using these values in the
[windows `MetadataExt` trait] which uses `u32`. I submitted
BurntSushi/winapi-util#7 to propose changing the types upstream.

[windows `MetadataExt` trait]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html
snev68 added a commit to snev68/cap-std that referenced this pull request Aug 5, 2024
Use `winapi_util::file::information` in place of `winx::file::get_fileinfo`,
which is simpler, except for needing to convert the types, which we need
to do because we're ultimately using these values in the
[windows `MetadataExt` trait] which uses `u32`. I submitted
BurntSushi/winapi-util#7 to propose changing the types upstream.

[windows `MetadataExt` trait]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html
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.

1 participant