Crate windows_core
Expand description
§Core type support for COM and Windows
The windows-core crate provides core type support for the windows-* family of crates.
Macros§
- h
- A literal HSTRING, length-prefixed wide string with a trailing null terminator.
- s
- A literal UTF-8 string with a trailing null terminator.
- w
- A literal UTF-16 wide string with a trailing null terminator.
Structs§
- Agile
Reference - A type representing an agile reference to a COM/WinRT object.
- Array
- A WinRT array stores elements contiguously in a heap-allocated buffer.
- BOOL
- A 32-bit value representing boolean values and returned by some functions to indicate success or failure.
- BSTR
- A BSTR string (BSTR) is a length-prefixed wide string.
- ComObject
- A counted pointer to a type that implements COM interfaces, where the object has been placed in the heap (boxed).
- Error
- An error object consists of both an error code and optional detailed error information for debugging.
- Event
- A type that you can use to declare and implement an event of a specified delegate type.
- GUID
- A globally unique identifier (GUID) used to identify COM and WinRT interfaces.
- HRESULT
- An error code value returned by most COM functions.
- HSTRING
- An (HSTRING) is a reference-counted and immutable UTF-16 string type.
- HString
Builder - An HSTRING builder that supports preallocating the
HSTRING
to avoid extra allocations and copies. - IInspectable
- Parent interface for all WinRT interfaces.
- IUnknown
- Base interface for all COM interfaces.
- Interface
Ref - This has the same memory representation as
IFoo
, but represents a borrowed interface pointer. - OutRef
- A borrowed type with the same memory layout as the type itself that can be used to construct ABI-compatible function signatures.
- Owned
- A wrapper to provide ownership for handles to automatically drop via the handle’s
Free
trait. - PCSTR
- A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
- PCWSTR
- A pointer to a constant null-terminated string of 16-bit Unicode characters.
- PSTR
- A pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
- PWSTR
- A pointer to a null-terminated string of 16-bit Unicode characters.
- Ref
- A borrowed type with the same memory layout as the type itself that can be used to construct ABI-compatible function signatures.
- Static
ComObject - Enables applications to define COM objects using static storage. This is useful for factory objects, stateless objects, or objects which use need to contain or use mutable global state.
- Weak
Weak
holds a non-owning reference to an object.
Traits§
- AsImpl
- A trait for retrieving the implementation behind a COM or WinRT interface.
- ComObject
Inner - Identifies types that can be placed in
ComObject
. - ComObject
Interface - Describes the COM interfaces implemented by a specific COM object.
- Free
- Custom code to free a handle.
- Interface
- Provides low-level access to an interface vtable.
- OutParam
- Provides automatic parameter conversion in cases where the Windows API expects implicit conversion support.
- Param
- Provides automatic parameter conversion in cases where the Windows API expects implicit conversion support.
Functions§
- factory
- Attempts to load the factory object for the given WinRT class. This can be used to access COM interfaces implemented on a Windows Runtime class factory.