From 4e8199b572f2035b7749cba276ece3a26630d23e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:21 +0200 Subject: Adding upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/windows-sys/readme.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'vendor/windows-sys/readme.md') diff --git a/vendor/windows-sys/readme.md b/vendor/windows-sys/readme.md index 3ea73c2c2..f4d62243d 100644 --- a/vendor/windows-sys/readme.md +++ b/vendor/windows-sys/readme.md @@ -1,9 +1,6 @@ -[![crates.io](https://img.shields.io/crates/v/windows.svg)](https://crates.io/crates/windows) -[![build](https://github.com/microsoft/windows-rs/workflows/build/badge.svg?event=push)](https://github.com/microsoft/windows-rs/actions) - ## Rust for Windows -The `windows` crate lets you call any Windows API past, present, and future using code generated on the fly directly from the metadata describing the API and right into your Rust package where you can call them as if they were just another Rust module. The Rust language projection follows in the tradition established by [C++/WinRT](https://github.com/microsoft/cppwinrt) of building language projections for Windows using standard languages and compilers, providing a natural and idiomatic way for Rust developers to call Windows APIs. +The `windows` and `windows-sys` crates let you call any Windows API past, present, and future using code generated on the fly directly from the [metadata describing the API](https://github.com/microsoft/windows-rs/tree/master/crates/libs/metadata/default) and right into your Rust package where you can call them as if they were just another Rust module. The Rust language projection follows in the tradition established by [C++/WinRT](https://github.com/microsoft/cppwinrt) of building language projections for Windows using standard languages and compilers, providing a natural and idiomatic way for Rust developers to call Windows APIs. * Crate documentation * [windows](https://microsoft.github.io/windows-docs-rs/) @@ -16,9 +13,8 @@ Start by adding the following to your Cargo.toml file: ```toml [dependencies.windows] -version = "0.36.1" +version = "0.42.0" features = [ - "alloc", "Data_Xml_Dom", "Win32_Foundation", "Win32_Security", @@ -37,19 +33,20 @@ use windows::{ fn main() -> Result<()> { let doc = XmlDocument::new()?; - doc.LoadXml("hello world")?; + doc.LoadXml(w!("hello world"))?; let root = doc.DocumentElement()?; assert!(root.NodeName()? == "html"); assert!(root.InnerText()? == "hello world"); unsafe { - let event = CreateEventW(std::ptr::null(), true, false, None)?; + let event = CreateEventW(None, true, false, None)?; SetEvent(event).ok()?; WaitForSingleObject(event, 0); CloseHandle(event).ok()?; - MessageBoxA(None, "Text", "Caption", MB_OK); + MessageBoxA(None, s!("Ansi"), s!("Caption"), MB_OK); + MessageBoxW(None, w!("Wide"), w!("Caption"), MB_OK); } Ok(()) @@ -64,8 +61,8 @@ Start by adding the following to your Cargo.toml file: ```toml [dependencies.windows-sys] -version = "0.36.1" -features = [ +version = "0.42.0" +6features = [ "Win32_Foundation", "Win32_Security", "Win32_System_Threading", @@ -77,7 +74,7 @@ Make use of any Windows APIs as needed. ```rust use windows_sys::{ - Win32::Foundation::*, Win32::System::Threading::*, Win32::UI::WindowsAndMessaging::*, + core::*, Win32::Foundation::*, Win32::System::Threading::*, Win32::UI::WindowsAndMessaging::*, }; fn main() { @@ -87,7 +84,8 @@ fn main() { WaitForSingleObject(event, 0); CloseHandle(event); - MessageBoxA(0, b"Text\0".as_ptr(), b"Caption\0".as_ptr(), MB_OK); + MessageBoxA(0, s!("Ansi"), s!("Caption"), MB_OK); + MessageBoxW(0, w!("Wide"), w!("Caption"), MB_OK); } } ``` -- cgit v1.2.3