| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IAppCapability(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IAppCapability { |
| type Vtable = IAppCapability_Vtbl; |
| } |
| impl ::core::clone::Clone for IAppCapability { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IAppCapability { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x4c49d915_8a2a_4295_9437_2df7c396aff4); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IAppCapability_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub CapabilityName: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>) -> ::windows_core::HRESULT, |
| #[cfg(feature = "System")] |
| pub User: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "System"))] |
| User: usize, |
| #[cfg(feature = "Foundation")] |
| pub RequestAccessAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| RequestAccessAsync: usize, |
| pub CheckAccess: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut AppCapabilityAccessStatus) -> ::windows_core::HRESULT, |
| #[cfg(feature = "Foundation")] |
| pub AccessChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| AccessChanged: usize, |
| #[cfg(feature = "Foundation")] |
| pub RemoveAccessChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| RemoveAccessChanged: usize, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IAppCapability2(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IAppCapability2 { |
| type Vtable = IAppCapability2_Vtbl; |
| } |
| impl ::core::clone::Clone for IAppCapability2 { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IAppCapability2 { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x11c7ccb6_c74f_50a3_b960_88008767d939); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IAppCapability2_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub DisplayMessage: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>) -> ::windows_core::HRESULT, |
| pub SetDisplayMessage: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::std::mem::MaybeUninit<::windows_core::HSTRING>) -> ::windows_core::HRESULT, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IAppCapabilityAccessChangedEventArgs(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IAppCapabilityAccessChangedEventArgs { |
| type Vtable = IAppCapabilityAccessChangedEventArgs_Vtbl; |
| } |
| impl ::core::clone::Clone for IAppCapabilityAccessChangedEventArgs { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IAppCapabilityAccessChangedEventArgs { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x0a578d15_bdd7_457e_8cca_6f53bd2e5944); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IAppCapabilityAccessChangedEventArgs_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IAppCapabilityStatics(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IAppCapabilityStatics { |
| type Vtable = IAppCapabilityStatics_Vtbl; |
| } |
| impl ::core::clone::Clone for IAppCapabilityStatics { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IAppCapabilityStatics { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x7c353e2a_46ee_44e5_af3d_6ad3fc49bd22); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IAppCapabilityStatics_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| #[cfg(feature = "Foundation_Collections")] |
| pub RequestAccessForCapabilitiesAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, capabilitynames: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation_Collections"))] |
| RequestAccessForCapabilitiesAsync: usize, |
| #[cfg(all(feature = "Foundation_Collections", feature = "System"))] |
| pub RequestAccessForCapabilitiesForUserAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, user: *mut ::core::ffi::c_void, capabilitynames: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(all(feature = "Foundation_Collections", feature = "System")))] |
| RequestAccessForCapabilitiesForUserAsync: usize, |
| pub Create: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, capabilityname: ::std::mem::MaybeUninit<::windows_core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(feature = "System")] |
| pub CreateWithProcessIdForUser: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, user: *mut ::core::ffi::c_void, capabilityname: ::std::mem::MaybeUninit<::windows_core::HSTRING>, pid: u32, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "System"))] |
| CreateWithProcessIdForUser: usize, |
| } |
| #[doc = "*Required features: `\"Security_Authorization_AppCapabilityAccess\"`*"] |
| #[repr(transparent)] |
| pub struct AppCapability(::windows_core::IUnknown); |
| impl AppCapability { |
| pub fn CapabilityName(&self) -> ::windows_core::Result<::windows_core::HSTRING> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CapabilityName)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"System\"`*"] |
| #[cfg(feature = "System")] |
| pub fn User(&self) -> ::windows_core::Result<super::super::super::System::User> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).User)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn RequestAccessAsync(&self) -> ::windows_core::Result<super::super::super::Foundation::IAsyncOperation<AppCapabilityAccessStatus>> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).RequestAccessAsync)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn CheckAccess(&self) -> ::windows_core::Result<AppCapabilityAccessStatus> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CheckAccess)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn AccessChanged<P0>(&self, handler: P0) -> ::windows_core::Result<super::super::super::Foundation::EventRegistrationToken> |
| where |
| P0: ::windows_core::IntoParam<super::super::super::Foundation::TypedEventHandler<AppCapability, AppCapabilityAccessChangedEventArgs>>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).AccessChanged)(::windows_core::Interface::as_raw(this), handler.into_param().abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn RemoveAccessChanged(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::Result<()> { |
| let this = self; |
| unsafe { (::windows_core::Interface::vtable(this).RemoveAccessChanged)(::windows_core::Interface::as_raw(this), token).ok() } |
| } |
| pub fn DisplayMessage(&self) -> ::windows_core::Result<::windows_core::HSTRING> { |
| let this = &::windows_core::ComInterface::cast::<IAppCapability2>(self)?; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).DisplayMessage)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn SetDisplayMessage(&self, value: &::windows_core::HSTRING) -> ::windows_core::Result<()> { |
| let this = &::windows_core::ComInterface::cast::<IAppCapability2>(self)?; |
| unsafe { (::windows_core::Interface::vtable(this).SetDisplayMessage)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(value)).ok() } |
| } |
| #[doc = "*Required features: `\"Foundation_Collections\"`*"] |
| #[cfg(feature = "Foundation_Collections")] |
| pub fn RequestAccessForCapabilitiesAsync<P0>(capabilitynames: P0) -> ::windows_core::Result<super::super::super::Foundation::IAsyncOperation<super::super::super::Foundation::Collections::IMapView<::windows_core::HSTRING, AppCapabilityAccessStatus>>> |
| where |
| P0: ::windows_core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows_core::HSTRING>>, |
| { |
| Self::IAppCapabilityStatics(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).RequestAccessForCapabilitiesAsync)(::windows_core::Interface::as_raw(this), capabilitynames.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Foundation_Collections\"`, `\"System\"`*"] |
| #[cfg(all(feature = "Foundation_Collections", feature = "System"))] |
| pub fn RequestAccessForCapabilitiesForUserAsync<P0, P1>(user: P0, capabilitynames: P1) -> ::windows_core::Result<super::super::super::Foundation::IAsyncOperation<super::super::super::Foundation::Collections::IMapView<::windows_core::HSTRING, AppCapabilityAccessStatus>>> |
| where |
| P0: ::windows_core::IntoParam<super::super::super::System::User>, |
| P1: ::windows_core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows_core::HSTRING>>, |
| { |
| Self::IAppCapabilityStatics(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).RequestAccessForCapabilitiesForUserAsync)(::windows_core::Interface::as_raw(this), user.into_param().abi(), capabilitynames.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| pub fn Create(capabilityname: &::windows_core::HSTRING) -> ::windows_core::Result<AppCapability> { |
| Self::IAppCapabilityStatics(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Create)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(capabilityname), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"System\"`*"] |
| #[cfg(feature = "System")] |
| pub fn CreateWithProcessIdForUser<P0>(user: P0, capabilityname: &::windows_core::HSTRING, pid: u32) -> ::windows_core::Result<AppCapability> |
| where |
| P0: ::windows_core::IntoParam<super::super::super::System::User>, |
| { |
| Self::IAppCapabilityStatics(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CreateWithProcessIdForUser)(::windows_core::Interface::as_raw(this), user.into_param().abi(), ::core::mem::transmute_copy(capabilityname), pid, &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc(hidden)] |
| pub fn IAppCapabilityStatics<R, F: FnOnce(&IAppCapabilityStatics) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> { |
| static SHARED: ::windows_core::imp::FactoryCache<AppCapability, IAppCapabilityStatics> = ::windows_core::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| } |
| impl ::core::cmp::PartialEq for AppCapability { |
| fn eq(&self, other: &Self) -> bool { |
| self.0 == other.0 |
| } |
| } |
| impl ::core::cmp::Eq for AppCapability {} |
| impl ::core::fmt::Debug for AppCapability { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("AppCapability").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for AppCapability { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Security.Authorization.AppCapabilityAccess.AppCapability;{4c49d915-8a2a-4295-9437-2df7c396aff4})"); |
| } |
| impl ::core::clone::Clone for AppCapability { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::Interface for AppCapability { |
| type Vtable = IAppCapability_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for AppCapability { |
| const IID: ::windows_core::GUID = <IAppCapability as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for AppCapability { |
| const NAME: &'static str = "Windows.Security.Authorization.AppCapabilityAccess.AppCapability"; |
| } |
| ::windows_core::imp::interface_hierarchy!(AppCapability, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for AppCapability {} |
| unsafe impl ::core::marker::Sync for AppCapability {} |
| #[doc = "*Required features: `\"Security_Authorization_AppCapabilityAccess\"`*"] |
| #[repr(transparent)] |
| pub struct AppCapabilityAccessChangedEventArgs(::windows_core::IUnknown); |
| impl AppCapabilityAccessChangedEventArgs {} |
| impl ::core::cmp::PartialEq for AppCapabilityAccessChangedEventArgs { |
| fn eq(&self, other: &Self) -> bool { |
| self.0 == other.0 |
| } |
| } |
| impl ::core::cmp::Eq for AppCapabilityAccessChangedEventArgs {} |
| impl ::core::fmt::Debug for AppCapabilityAccessChangedEventArgs { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("AppCapabilityAccessChangedEventArgs").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for AppCapabilityAccessChangedEventArgs { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Security.Authorization.AppCapabilityAccess.AppCapabilityAccessChangedEventArgs;{0a578d15-bdd7-457e-8cca-6f53bd2e5944})"); |
| } |
| impl ::core::clone::Clone for AppCapabilityAccessChangedEventArgs { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::Interface for AppCapabilityAccessChangedEventArgs { |
| type Vtable = IAppCapabilityAccessChangedEventArgs_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for AppCapabilityAccessChangedEventArgs { |
| const IID: ::windows_core::GUID = <IAppCapabilityAccessChangedEventArgs as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for AppCapabilityAccessChangedEventArgs { |
| const NAME: &'static str = "Windows.Security.Authorization.AppCapabilityAccess.AppCapabilityAccessChangedEventArgs"; |
| } |
| ::windows_core::imp::interface_hierarchy!(AppCapabilityAccessChangedEventArgs, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for AppCapabilityAccessChangedEventArgs {} |
| unsafe impl ::core::marker::Sync for AppCapabilityAccessChangedEventArgs {} |
| #[doc = "*Required features: `\"Security_Authorization_AppCapabilityAccess\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct AppCapabilityAccessStatus(pub i32); |
| impl AppCapabilityAccessStatus { |
| pub const DeniedBySystem: Self = Self(0i32); |
| pub const NotDeclaredByApp: Self = Self(1i32); |
| pub const DeniedByUser: Self = Self(2i32); |
| pub const UserPromptRequired: Self = Self(3i32); |
| pub const Allowed: Self = Self(4i32); |
| } |
| impl ::core::marker::Copy for AppCapabilityAccessStatus {} |
| impl ::core::clone::Clone for AppCapabilityAccessStatus { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for AppCapabilityAccessStatus { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows_core::TypeKind for AppCapabilityAccessStatus { |
| type TypeKind = ::windows_core::CopyType; |
| } |
| impl ::core::fmt::Debug for AppCapabilityAccessStatus { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("AppCapabilityAccessStatus").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for AppCapabilityAccessStatus { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Security.Authorization.AppCapabilityAccess.AppCapabilityAccessStatus;i4)"); |
| } |