The string types used across the Windows APIs.
- 馃摝 crates.io
- 馃摉 docs.rs
- 馃殌 Getting started
- 馃搧 Source
windows-strings provides the owned and borrowed string types that Windows APIs
expect: HSTRING (the reference-counted UTF-16 string used throughout WinRT),
BSTR (the length-prefixed UTF-16 string used by COM automation), and
PCSTR/PCWSTR (borrowed, null-terminated ANSI/UTF-16 pointers). The s!,
w!, and h! macros build null-terminated literals at compile time.
The remainder of this page covers how the crate is built and maintained. It is
for contributors and is not needed to use windows-strings.
src/bindings.rs is generated by tool_bindings from
crates/tools/bindings/src/strings.txt; the string types and macros are
hand-written.
Run cargo test -p windows-strings; see also the workspace test crates.