| #[cfg(feature = "Security_Cryptography_Certificates")] |
| pub mod Certificates; |
| #[cfg(feature = "Security_Cryptography_Core")] |
| pub mod Core; |
| #[cfg(feature = "Security_Cryptography_DataProtection")] |
| pub mod DataProtection; |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct ICryptographicBufferStatics(::windows::core::IUnknown); |
| unsafe impl ::windows::core::Interface for ICryptographicBufferStatics { |
| type Vtable = ICryptographicBufferStatics_Vtbl; |
| } |
| impl ::core::clone::Clone for ICryptographicBufferStatics { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows::core::ComInterface for ICryptographicBufferStatics { |
| const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x320b7e22_3cb0_4cdf_8663_1d28910065eb); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct ICryptographicBufferStatics_Vtbl { |
| pub base__: ::windows::core::IInspectable_Vtbl, |
| #[cfg(feature = "Storage_Streams")] |
| pub Compare: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, object1: *mut ::core::ffi::c_void, object2: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| Compare: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub GenerateRandom: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, length: u32, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| GenerateRandom: usize, |
| pub GenerateRandomNumber: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT, |
| #[cfg(feature = "Storage_Streams")] |
| pub CreateFromByteArray: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value_array_size: u32, value: *const u8, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| CreateFromByteArray: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub CopyToByteArray: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, buffer: *mut ::core::ffi::c_void, value_array_size: *mut u32, value: *mut *mut u8) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| CopyToByteArray: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub DecodeFromHexString: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| DecodeFromHexString: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub EncodeToHexString: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, buffer: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| EncodeToHexString: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub DecodeFromBase64String: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| DecodeFromBase64String: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub EncodeToBase64String: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, buffer: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| EncodeToBase64String: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub ConvertStringToBinary: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::std::mem::MaybeUninit<::windows::core::HSTRING>, encoding: BinaryStringEncoding, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| ConvertStringToBinary: usize, |
| #[cfg(feature = "Storage_Streams")] |
| pub ConvertBinaryToString: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, encoding: BinaryStringEncoding, buffer: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT, |
| #[cfg(not(feature = "Storage_Streams"))] |
| ConvertBinaryToString: usize, |
| } |
| #[doc = "*Required features: `\"Security_Cryptography\"`*"] |
| pub struct CryptographicBuffer; |
| impl CryptographicBuffer { |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn Compare<P0, P1>(object1: P0, object2: P1) -> ::windows::core::Result<bool> |
| where |
| P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| P1: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<bool>(); |
| (::windows::core::Interface::vtable(this).Compare)(::windows::core::Interface::as_raw(this), object1.try_into_param()?.abi(), object2.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn GenerateRandom(length: u32) -> ::windows::core::Result<super::super::Storage::Streams::IBuffer> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<super::super::Storage::Streams::IBuffer>(); |
| (::windows::core::Interface::vtable(this).GenerateRandom)(::windows::core::Interface::as_raw(this), length, &mut result__).from_abi(result__) |
| }) |
| } |
| pub fn GenerateRandomNumber() -> ::windows::core::Result<u32> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<u32>(); |
| (::windows::core::Interface::vtable(this).GenerateRandomNumber)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn CreateFromByteArray(value: &[u8]) -> ::windows::core::Result<super::super::Storage::Streams::IBuffer> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<super::super::Storage::Streams::IBuffer>(); |
| (::windows::core::Interface::vtable(this).CreateFromByteArray)(::windows::core::Interface::as_raw(this), value.len() as u32, value.as_ptr(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn CopyToByteArray<P0>(buffer: P0, value: &mut ::windows::core::Array<u8>) -> ::windows::core::Result<()> |
| where |
| P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| { |
| Self::ICryptographicBufferStatics(|this| unsafe { (::windows::core::Interface::vtable(this).CopyToByteArray)(::windows::core::Interface::as_raw(this), buffer.try_into_param()?.abi(), value.set_abi_len(), value as *mut _ as _).ok() }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn DecodeFromHexString(value: &::windows::core::HSTRING) -> ::windows::core::Result<super::super::Storage::Streams::IBuffer> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<super::super::Storage::Streams::IBuffer>(); |
| (::windows::core::Interface::vtable(this).DecodeFromHexString)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(value), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn EncodeToHexString<P0>(buffer: P0) -> ::windows::core::Result<::windows::core::HSTRING> |
| where |
| P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>(); |
| (::windows::core::Interface::vtable(this).EncodeToHexString)(::windows::core::Interface::as_raw(this), buffer.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn DecodeFromBase64String(value: &::windows::core::HSTRING) -> ::windows::core::Result<super::super::Storage::Streams::IBuffer> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<super::super::Storage::Streams::IBuffer>(); |
| (::windows::core::Interface::vtable(this).DecodeFromBase64String)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(value), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn EncodeToBase64String<P0>(buffer: P0) -> ::windows::core::Result<::windows::core::HSTRING> |
| where |
| P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>(); |
| (::windows::core::Interface::vtable(this).EncodeToBase64String)(::windows::core::Interface::as_raw(this), buffer.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn ConvertStringToBinary(value: &::windows::core::HSTRING, encoding: BinaryStringEncoding) -> ::windows::core::Result<super::super::Storage::Streams::IBuffer> { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<super::super::Storage::Streams::IBuffer>(); |
| (::windows::core::Interface::vtable(this).ConvertStringToBinary)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(value), encoding, &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Storage_Streams\"`*"] |
| #[cfg(feature = "Storage_Streams")] |
| pub fn ConvertBinaryToString<P0>(encoding: BinaryStringEncoding, buffer: P0) -> ::windows::core::Result<::windows::core::HSTRING> |
| where |
| P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IBuffer>, |
| { |
| Self::ICryptographicBufferStatics(|this| unsafe { |
| let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>(); |
| (::windows::core::Interface::vtable(this).ConvertBinaryToString)(::windows::core::Interface::as_raw(this), encoding, buffer.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc(hidden)] |
| pub fn ICryptographicBufferStatics<R, F: FnOnce(&ICryptographicBufferStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { |
| static SHARED: ::windows::imp::FactoryCache<CryptographicBuffer, ICryptographicBufferStatics> = ::windows::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| } |
| impl ::windows::core::RuntimeName for CryptographicBuffer { |
| const NAME: &'static str = "Windows.Security.Cryptography.CryptographicBuffer"; |
| } |
| #[doc = "*Required features: `\"Security_Cryptography\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct BinaryStringEncoding(pub i32); |
| impl BinaryStringEncoding { |
| pub const Utf8: Self = Self(0i32); |
| pub const Utf16LE: Self = Self(1i32); |
| pub const Utf16BE: Self = Self(2i32); |
| } |
| impl ::core::marker::Copy for BinaryStringEncoding {} |
| impl ::core::clone::Clone for BinaryStringEncoding { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for BinaryStringEncoding { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows::core::TypeKind for BinaryStringEncoding { |
| type TypeKind = ::windows::core::CopyType; |
| } |
| impl ::core::fmt::Debug for BinaryStringEncoding { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("BinaryStringEncoding").field(&self.0).finish() |
| } |
| } |
| impl ::windows::core::RuntimeType for BinaryStringEncoding { |
| const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.Security.Cryptography.BinaryStringEncoding;i4)"); |
| } |
| #[cfg(feature = "implement")] |
| ::core::include!("impl.rs"); |