Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeKeyHandle.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Runtime.InteropServices
;
3
using
Microsoft.Win32.SafeHandles
;
4
5
namespace
Internal.NativeCrypto
;
6
7
internal
sealed
class
SafeKeyHandle :
Microsoft
.Win32.SafeHandles.
SafeBCryptHandle
8
{
9
private
Internal.NativeCrypto.SafeAlgorithmHandle
_parentHandle
;
10
11
public
void
SetParentHandle
(
Internal
.
NativeCrypto
.
SafeAlgorithmHandle
parentHandle)
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
{
22
_parentHandle
.
DangerousRelease
();
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
Definition
SafeAlgorithmHandle.cs:8
Internal.NativeCrypto.SafeKeyHandle.ReleaseHandle
override bool ReleaseHandle()
Definition
SafeKeyHandle.cs:18
Internal.NativeCrypto.SafeKeyHandle._parentHandle
Internal.NativeCrypto.SafeAlgorithmHandle _parentHandle
Definition
SafeKeyHandle.cs:9
Internal.NativeCrypto.SafeKeyHandle._parentHandle
SafeAlgorithmHandle _parentHandle
Definition
SafeKeyHandle.cs:9
Internal.NativeCrypto.SafeKeyHandle.BCryptDestroyKey
static uint BCryptDestroyKey(IntPtr hKey)
Internal.NativeCrypto.SafeKeyHandle.SetParentHandle
void SetParentHandle(Internal.NativeCrypto.SafeAlgorithmHandle parentHandle)
Definition
SafeKeyHandle.cs:11
Microsoft.Win32.SafeHandles.SafeBCryptHandle
Definition
SafeBCryptHandle.cs:7
System.Runtime.InteropServices.SafeHandle.DangerousRelease
void DangerousRelease()
Definition
SafeHandle.cs:93
System.Runtime.InteropServices.SafeHandle.handle
IntPtr handle
Definition
SafeHandle.cs:8
Internal.NativeCrypto
Definition
Cng.cs:6
Internal
Definition
Unsafe.cs:6
Microsoft.Win32.SafeHandles
Definition
SafeProcessHandle.cs:3
Microsoft
Definition
AlphaTestEffect.cs:1
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
System
Definition
BlockingCollection.cs:8
System.IntPtr
Definition
IntPtr.cs:14
source
System.Security.Cryptography.Cng
Internal.NativeCrypto
SafeKeyHandle.cs
Generated by
1.10.0