| #[doc(hidden)] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)] |
| pub struct IDataProtectionProvider(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IDataProtectionProvider { |
| type Vtable = IDataProtectionProvider_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for IDataProtectionProvider { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x09639948_ed22_4270_bd1c_6d72c00f8787); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IDataProtectionProvider_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub ProtectAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, data: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))] |
| ProtectAsync: usize, |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub UnprotectAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, data: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))] |
| UnprotectAsync: usize, |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub ProtectStreamAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, src: *mut ::core::ffi::c_void, dest: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))] |
| ProtectStreamAsync: usize, |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub UnprotectStreamAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, src: *mut ::core::ffi::c_void, dest: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))] |
| UnprotectStreamAsync: usize, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)] |
| pub struct IDataProtectionProviderFactory(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IDataProtectionProviderFactory { |
| type Vtable = IDataProtectionProviderFactory_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for IDataProtectionProviderFactory { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0xadf33dac_4932_4cdf_ac41_7214333514ca); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IDataProtectionProviderFactory_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub CreateOverloadExplicit: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, protectiondescriptor: ::std::mem::MaybeUninit<::windows_core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| } |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)] |
| pub struct DataProtectionProvider(::windows_core::IUnknown); |
| impl DataProtectionProvider { |
| pub fn new() -> ::windows_core::Result<Self> { |
| Self::IActivationFactory(|f| f.ActivateInstance::<Self>()) |
| } |
| fn IActivationFactory<R, F: FnOnce(&::windows_core::imp::IGenericFactory) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> { |
| static SHARED: ::windows_core::imp::FactoryCache<DataProtectionProvider, ::windows_core::imp::IGenericFactory> = ::windows_core::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| #[doc = "Required features: `\"Foundation\"`, `\"Storage_Streams\"`"] |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub fn ProtectAsync<P0>(&self, data: P0) -> ::windows_core::Result<super::super::super::Foundation::IAsyncOperation<super::super::super::Storage::Streams::IBuffer>> |
| where |
| P0: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IBuffer>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).ProtectAsync)(::windows_core::Interface::as_raw(this), data.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "Required features: `\"Foundation\"`, `\"Storage_Streams\"`"] |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub fn UnprotectAsync<P0>(&self, data: P0) -> ::windows_core::Result<super::super::super::Foundation::IAsyncOperation<super::super::super::Storage::Streams::IBuffer>> |
| where |
| P0: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IBuffer>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).UnprotectAsync)(::windows_core::Interface::as_raw(this), data.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "Required features: `\"Foundation\"`, `\"Storage_Streams\"`"] |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub fn ProtectStreamAsync<P0, P1>(&self, src: P0, dest: P1) -> ::windows_core::Result<super::super::super::Foundation::IAsyncAction> |
| where |
| P0: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IInputStream>, |
| P1: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IOutputStream>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).ProtectStreamAsync)(::windows_core::Interface::as_raw(this), src.try_into_param()?.abi(), dest.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "Required features: `\"Foundation\"`, `\"Storage_Streams\"`"] |
| #[cfg(all(feature = "Foundation", feature = "Storage_Streams"))] |
| pub fn UnprotectStreamAsync<P0, P1>(&self, src: P0, dest: P1) -> ::windows_core::Result<super::super::super::Foundation::IAsyncAction> |
| where |
| P0: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IInputStream>, |
| P1: ::windows_core::TryIntoParam<super::super::super::Storage::Streams::IOutputStream>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).UnprotectStreamAsync)(::windows_core::Interface::as_raw(this), src.try_into_param()?.abi(), dest.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn CreateOverloadExplicit(protectiondescriptor: &::windows_core::HSTRING) -> ::windows_core::Result<DataProtectionProvider> { |
| Self::IDataProtectionProviderFactory(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CreateOverloadExplicit)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(protectiondescriptor), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc(hidden)] |
| pub fn IDataProtectionProviderFactory<R, F: FnOnce(&IDataProtectionProviderFactory) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> { |
| static SHARED: ::windows_core::imp::FactoryCache<DataProtectionProvider, IDataProtectionProviderFactory> = ::windows_core::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| } |
| impl ::windows_core::RuntimeType for DataProtectionProvider { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Security.Cryptography.DataProtection.DataProtectionProvider;{09639948-ed22-4270-bd1c-6d72c00f8787})"); |
| } |
| unsafe impl ::windows_core::Interface for DataProtectionProvider { |
| type Vtable = IDataProtectionProvider_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for DataProtectionProvider { |
| const IID: ::windows_core::GUID = <IDataProtectionProvider as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for DataProtectionProvider { |
| const NAME: &'static str = "Windows.Security.Cryptography.DataProtection.DataProtectionProvider"; |
| } |
| ::windows_core::imp::interface_hierarchy!(DataProtectionProvider, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for DataProtectionProvider {} |
| unsafe impl ::core::marker::Sync for DataProtectionProvider {} |