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-core/src/windows.rs | |
| parent | 4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff) | |
chore: add vendor directory
Diffstat (limited to 'vendor/windows-core/src/windows.rs')
| -rw-r--r-- | vendor/windows-core/src/windows.rs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/vendor/windows-core/src/windows.rs b/vendor/windows-core/src/windows.rs new file mode 100644 index 00000000..6f055bbc --- /dev/null +++ b/vendor/windows-core/src/windows.rs @@ -0,0 +1,73 @@ +mod agile_reference; +pub use agile_reference::*; + +mod array; +pub use array::*; + +#[cfg(feature = "std")] +mod event; +#[cfg(feature = "std")] +pub use event::*; + +mod handles; +pub use handles::*; + +pub use windows_strings::*; + +/// 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. +pub fn factory<C: RuntimeName, I: Interface>() -> Result<I> { + imp::load_factory::<C, I>() +} + +impl Param<PCWSTR> for &BSTR { + unsafe fn param(self) -> ParamValue<PCWSTR> { + ParamValue::Owned(PCWSTR(self.as_ptr())) + } +} + +impl Param<PCWSTR> for &HSTRING { + unsafe fn param(self) -> ParamValue<PCWSTR> { + ParamValue::Owned(PCWSTR(self.as_ptr())) + } +} + +impl Param<PCWSTR> for PWSTR { + unsafe fn param(self) -> ParamValue<PCWSTR> { + ParamValue::Owned(PCWSTR(self.0)) + } +} + +impl Param<PCSTR> for PSTR { + unsafe fn param(self) -> ParamValue<PCSTR> { + ParamValue::Owned(PCSTR(self.0)) + } +} + +impl RuntimeType for HSTRING { + const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice(b"string"); +} + +impl TypeKind for PWSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PCWSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PCSTR { + type TypeKind = CopyType; +} + +impl TypeKind for HSTRING { + type TypeKind = CloneType; +} + +impl TypeKind for BSTR { + type TypeKind = CloneType; +} |
