protected override bool ReleaseHandle()
        {
            bool successfullyFreed = Interop.Advapi32.CryptDestroyHash(handle);
            Debug.Assert(successfullyFreed);

            SafeProvHandle? parent = _parent;
            _parent = null;
            parent?.DangerousRelease();

            return successfullyFreed;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Закрытие HANDLE ключа ассоциированного с ним.
 /// </summary>
 ///
 /// <param name="disposing">Вызов из finalize.</param>
 protected override void Dispose(bool disposing)
 {
     if ((_safeKeyHandle != null) && !_safeKeyHandle.IsClosed)
     {
         _safeKeyHandle.DangerousRelease();
     }
     if ((_safeProvHandle != null) && !_safeProvHandle.IsClosed)
     {
         _safeProvHandle.DangerousRelease();
     }
     base.Dispose(disposing);
 }
Ejemplo n.º 3
0
        protected override bool ReleaseHandle()
        {
            bool successfullyFreed = CapiHelper.CryptDestroyHash(handle);

            Debug.Assert(successfullyFreed);

            SafeProvHandle parent = _parent;

            _parent = null;
            parent?.DangerousRelease();

            return(successfullyFreed);
        }