| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| #[inline] |
| pub unsafe fn RegisterLicenseKeyWithExpiration<'a, P0>(licensekey: P0, validityindays: u32) -> ::windows::core::Result<LicenseProtectionStatus> |
| where |
| P0: ::std::convert::Into<::windows::core::PCWSTR>, |
| { |
| #[cfg_attr(windows, link(name = "windows"))] |
| extern "system" { |
| fn RegisterLicenseKeyWithExpiration(licensekey: ::windows::core::PCWSTR, validityindays: u32, status: *mut LicenseProtectionStatus) -> ::windows::core::HRESULT; |
| } |
| let mut result__ = ::core::mem::MaybeUninit::zeroed(); |
| RegisterLicenseKeyWithExpiration(licensekey.into(), validityindays, ::core::mem::transmute(result__.as_mut_ptr())).from_abi::<LicenseProtectionStatus>(result__) |
| } |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`, `\"Win32_Foundation\"`*"] |
| #[cfg(feature = "Win32_Foundation")] |
| #[inline] |
| pub unsafe fn ValidateLicenseKeyProtection<'a, P0>(licensekey: P0, notvalidbefore: *mut super::super::Foundation::FILETIME, notvalidafter: *mut super::super::Foundation::FILETIME, status: *mut LicenseProtectionStatus) -> ::windows::core::Result<()> |
| where |
| P0: ::std::convert::Into<::windows::core::PCWSTR>, |
| { |
| #[cfg_attr(windows, link(name = "windows"))] |
| extern "system" { |
| fn ValidateLicenseKeyProtection(licensekey: ::windows::core::PCWSTR, notvalidbefore: *mut super::super::Foundation::FILETIME, notvalidafter: *mut super::super::Foundation::FILETIME, status: *mut LicenseProtectionStatus) -> ::windows::core::HRESULT; |
| } |
| ValidateLicenseKeyProtection(licensekey.into(), ::core::mem::transmute(notvalidbefore), ::core::mem::transmute(notvalidafter), ::core::mem::transmute(status)).ok() |
| } |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct LicenseProtectionStatus(pub i32); |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| pub const Success: LicenseProtectionStatus = LicenseProtectionStatus(0i32); |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| pub const LicenseKeyNotFound: LicenseProtectionStatus = LicenseProtectionStatus(1i32); |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| pub const LicenseKeyUnprotected: LicenseProtectionStatus = LicenseProtectionStatus(2i32); |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| pub const LicenseKeyCorrupted: LicenseProtectionStatus = LicenseProtectionStatus(3i32); |
| #[doc = "*Required features: `\"Win32_Security_LicenseProtection\"`*"] |
| pub const LicenseKeyAlreadyExists: LicenseProtectionStatus = LicenseProtectionStatus(4i32); |
| impl ::core::marker::Copy for LicenseProtectionStatus {} |
| impl ::core::clone::Clone for LicenseProtectionStatus { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for LicenseProtectionStatus { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| unsafe impl ::windows::core::Abi for LicenseProtectionStatus { |
| type Abi = Self; |
| } |
| impl ::core::fmt::Debug for LicenseProtectionStatus { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("LicenseProtectionStatus").field(&self.0).finish() |
| } |
| } |
| #[cfg(feature = "implement")] |
| ::core::include!("impl.rs"); |