diff --git a/crates/tests/lib/Cargo.toml b/crates/tests/lib/Cargo.toml index d5f8e059a8..d18199fcc6 100644 --- a/crates/tests/lib/Cargo.toml +++ b/crates/tests/lib/Cargo.toml @@ -12,6 +12,7 @@ features = [ "Win32_Graphics_Direct3D11", "Win32_Graphics_Gdi", "Win32_System_Threading", + "Win32_System_ClrHosting", ] [dependencies.windows-sys] diff --git a/crates/tests/lib/tests/win.rs b/crates/tests/lib/tests/win.rs index 4582cc1cb6..bf3e7e629e 100644 --- a/crates/tests/lib/tests/win.rs +++ b/crates/tests/lib/tests/win.rs @@ -1,4 +1,4 @@ -use windows::{core::*, Win32::Graphics::Direct3D::Fxc::*, Win32::Graphics::Gdi::*, Win32::System::Threading::*}; +use windows::{core::*, Win32::Graphics::Direct3D::Fxc::*, Win32::Graphics::Gdi::*, Win32::System::ClrHosting::*, Win32::System::Threading::*}; #[test] fn linker() -> Result<()> { @@ -21,3 +21,15 @@ fn wait_on_address() { WaitOnAddress(std::ptr::null(), std::ptr::null(), 0, 0); } } + +#[test] +fn clr() -> Result<()> { + unsafe { + let mut version = vec![0; 20]; + let mut len = 0; + GetFileVersion(w!("../../libs/metadata/default/Windows.winmd"), Some(&mut version), &mut len)?; + let version = String::from_utf16_lossy(&version[..len as usize - 1]); + assert_eq!(version, "WindowsRuntime 1.4"); + Ok(()) + } +}