1 using Microsoft.Win32.SafeHandles;
7 internal sealed
class SafeCertStoreHandle : SafeHandleZeroOrMinusOneIsInvalid
9 internal static SafeCertStoreHandle InvalidHandle =>
new SafeCertStoreHandle(IntPtr.Zero);
11 private SafeCertStoreHandle()
12 : base(ownsHandle: true)
16 internal SafeCertStoreHandle(IntPtr handle)
17 : base(ownsHandle: true)
22 [DllImport(
"crypt32.dll", SetLastError =
true)]
23 [SuppressUnmanagedCodeSecurity]
24 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
25 private static extern bool CertCloseStore(IntPtr hCertStore, uint dwFlags);
27 protected override bool ReleaseHandle()
29 return CertCloseStore(handle, 0u);
Cer
Specifies a method's behavior when called within a constrained execution region.
Consistency
Specifies a reliability contract.