Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HandleMarshaler.cs
Go to the documentation of this file.
1
using
System.Runtime.InteropServices
;
2
using
Internal.Runtime.CompilerServices
;
3
4
namespace
System.StubHelpers
;
5
6
internal
sealed
class
HandleMarshaler
7
{
8
internal
static
IntPtr
ConvertSafeHandleToNative
(
SafeHandle
handle
, ref
CleanupWorkListElement
cleanupWorkList)
9
{
10
if
(
Unsafe
.IsNullRef(ref cleanupWorkList))
11
{
12
throw
new
InvalidOperationException
(
SR
.
Interop_Marshal_SafeHandle_InvalidOperation
);
13
}
14
if
(
handle
==
null
)
15
{
16
throw
new
ArgumentNullException
(
"handle"
);
17
}
18
return
StubHelpers
.
AddToCleanupList
(ref cleanupWorkList,
handle
);
19
}
20
21
internal
static
void
ThrowSafeHandleFieldChanged
()
22
{
23
throw
new
NotSupportedException
(
SR
.
Interop_Marshal_CannotCreateSafeHandleField
);
24
}
25
26
internal
static
void
ThrowCriticalHandleFieldChanged
()
27
{
28
throw
new
NotSupportedException
(
SR
.
Interop_Marshal_CannotCreateCriticalHandleField
);
29
}
30
}
Internal.Runtime.CompilerServices.Unsafe
Definition
Unsafe.cs:10
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.InvalidOperationException
Definition
InvalidOperationException.cs:9
System.NotSupportedException
Definition
NotSupportedException.cs:9
System.Runtime.InteropServices.SafeHandle
Definition
SafeHandle.cs:7
System.SR.Interop_Marshal_CannotCreateCriticalHandleField
static string Interop_Marshal_CannotCreateCriticalHandleField
Definition
SR.cs:1380
System.SR.Interop_Marshal_CannotCreateSafeHandleField
static string Interop_Marshal_CannotCreateSafeHandleField
Definition
SR.cs:1378
System.SR.Interop_Marshal_SafeHandle_InvalidOperation
static string Interop_Marshal_SafeHandle_InvalidOperation
Definition
SR.cs:1376
System.SR
Definition
SR.cs:7
System.StubHelpers.CleanupWorkListElement
Definition
CleanupWorkListElement.cs:4
System.StubHelpers.HandleMarshaler.ConvertSafeHandleToNative
static IntPtr ConvertSafeHandleToNative(SafeHandle handle, ref CleanupWorkListElement cleanupWorkList)
Definition
HandleMarshaler.cs:8
System.StubHelpers.HandleMarshaler.ThrowCriticalHandleFieldChanged
static void ThrowCriticalHandleFieldChanged()
Definition
HandleMarshaler.cs:26
System.StubHelpers.HandleMarshaler.ThrowSafeHandleFieldChanged
static void ThrowSafeHandleFieldChanged()
Definition
HandleMarshaler.cs:21
System.StubHelpers.HandleMarshaler
Definition
HandleMarshaler.cs:7
System.StubHelpers.StubHelpers.AddToCleanupList
static IntPtr AddToCleanupList(ref CleanupWorkListElement pCleanupWorkList, SafeHandle handle)
Definition
StubHelpers.cs:29
System.StubHelpers.StubHelpers
Definition
StubHelpers.cs:7
Internal.Runtime.CompilerServices
Definition
Unsafe.cs:6
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
System.StubHelpers
Definition
AnsiBSTRMarshaler.cs:3
System.ExceptionArgument.handle
@ handle
System.IntPtr
Definition
IntPtr.cs:14
source
System.Private.CoreLib
System.StubHelpers
HandleMarshaler.cs
Generated by
1.10.0