You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[package]
name = "regqueryvaluerepro"version = "0.1.0"edition = "2021"
[dependencies]
windows = { version = "0.40.0", features = ["Win32_Foundation", "Win32_System_Registry"] }
Expected behavior
lpreserved should accept either std::ptr::null() or None
Actual behavior
lpreserved only accepts a valid reference which is an invalid argument
Additional comments
No response
The text was updated successfully, but these errors were encountered:
Thanks for reporting! This has now been fixed (#2036). I'll leave this open until I further apply Option to reserved parameters so that you can simply pass None instead of having to type std::ptr::null().
Which crate is this about?
windows
Crate version
0.40.0
Summary
RegQueryValueExA
has the following signature:The documentation states:
This means it can't be called as references should never be NULL.
&mut *std::ptr::null()
does work for me but is technically UB).I'm sure there's other cases like this since a lot of functions have this kind of argument but I couldn't find an existing issue.
Toolchain version/configuration
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\Mona.rustup
installed toolchains
stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)
Reproducible example
Crate manifest
Expected behavior
lpreserved
should accept eitherstd::ptr::null()
orNone
Actual behavior
lpreserved
only accepts a valid reference which is an invalid argumentAdditional comments
No response
The text was updated successfully, but these errors were encountered: