Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeKeyHandle.cs
Go to the documentation of this file.
1using System;
4
6
7internal sealed class SafeKeyHandle : Microsoft.Win32.SafeHandles.SafeBCryptHandle
8{
10
12 {
13 bool success = false;
14 parentHandle.DangerousAddRef(ref success);
15 _parentHandle = parentHandle;
16 }
17
18 protected sealed override bool ReleaseHandle()
19 {
20 if (_parentHandle != null)
21 {
23 _parentHandle = null;
24 }
25 uint num = BCryptDestroyKey(handle);
26 return num == 0;
27 }
28
29 [DllImport("BCrypt.dll")]
30 private static extern uint BCryptDestroyKey(IntPtr hKey);
31}
Internal.NativeCrypto.SafeAlgorithmHandle _parentHandle
static uint BCryptDestroyKey(IntPtr hKey)
void SetParentHandle(Internal.NativeCrypto.SafeAlgorithmHandle parentHandle)