Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active November 14, 2023 15:51
Show Gist options
  • Save kennykerr/e49dbaaea37eb360d0134d320a0e85d1 to your computer and use it in GitHub Desktop.
Save kennykerr/e49dbaaea37eb360d0134d320a0e85d1 to your computer and use it in GitHub Desktop.
RtlGetVersion
[dependencies.windows]
version = "0.51"
features = ["Win32_Foundation", "Win32_System_SystemInformation", "Wdk_System_SystemServices"]
use windows::{Wdk::System::SystemServices::*, Win32::System::SystemInformation::*};
fn main() {
unsafe {
let mut info = OSVERSIONINFOEXW {
dwOSVersionInfoSize: std::mem::size_of::<OSVERSIONINFOEXW>() as u32,
..Default::default()
};
_ = RtlGetVersion(&mut info as *mut _ as *mut _);
dbg!(info);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment