protected override bool ReleaseHandle() { bool successfullyFreed = Interop.Advapi32.CryptDestroyHash(handle); Debug.Assert(successfullyFreed); SafeProvHandle? parent = _parent; _parent = null; parent?.DangerousRelease(); return successfullyFreed; }
/// <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); }
protected override bool ReleaseHandle() { bool successfullyFreed = CapiHelper.CryptDestroyHash(handle); Debug.Assert(successfullyFreed); SafeProvHandle parent = _parent; _parent = null; parent?.DangerousRelease(); return(successfullyFreed); }