diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
| commit | 8cdfa445d6629ffef4cb84967ff7017654045bc2 (patch) | |
| tree | 22f0b0907c024c78d26a731e2e1f5219407d8102 /vendor/windows-strings/readme.md | |
| parent | 4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff) | |
chore: add vendor directory
Diffstat (limited to 'vendor/windows-strings/readme.md')
| -rw-r--r-- | vendor/windows-strings/readme.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/windows-strings/readme.md b/vendor/windows-strings/readme.md new file mode 100644 index 00000000..1e26e77b --- /dev/null +++ b/vendor/windows-strings/readme.md @@ -0,0 +1,34 @@ +## Windows string types + +The [windows-strings](https://crates.io/crates/windows-strings) crate provides common Windows string types used by various Windows APIs. + +* [Getting started](https://kennykerr.ca/rust-getting-started/) +* [Samples](https://github.com/microsoft/windows-rs/tree/master/crates/samples) +* [Releases](https://github.com/microsoft/windows-rs/releases) + +Start by adding the following to your Cargo.toml file: + +```toml +[dependencies.windows-strings] +version = "0.4" +``` + +Use the Windows string types as needed: + +```rust +use windows_strings::*; + +const A: PCSTR = s!("ansi"); +const W: PCWSTR = w!("wide"); + +fn main() { + let b = BSTR::from("bstr"); + let h = HSTRING::from("hstring"); + + assert_eq!(b, "bstr"); + assert_eq!(h, "hstring"); + + assert_eq!(unsafe { A.to_string().unwrap() }, "ansi"); + assert_eq!(unsafe { W.to_string().unwrap() }, "wide"); +} +``` |
