Skip to content

Latest commit

History

History
31 lines (21 loc) 路 1.11 KB

File metadata and controls

31 lines (21 loc) 路 1.11 KB

windows-strings

The string types used across the Windows APIs.

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.


Internal documentation

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.

How it's built

src/bindings.rs is generated by tool_bindings from crates/tools/bindings/src/strings.txt; the string types and macros are hand-written.

Testing

Run cargo test -p windows-strings; see also the workspace test crates.