Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MsQuicParameterHelpers.cs
Go to the documentation of this file.
1
using
System.Runtime.CompilerServices
;
2
using
System.Runtime.InteropServices
;
3
4
namespace
System.Net.Quic.Implementations.MsQuic.Internal
;
5
6
internal
static
class
MsQuicParameterHelpers
7
{
8
internal
unsafe
static
MsQuicNativeMethods.SOCKADDR_INET
GetINetParam
(
MsQuicApi
api,
SafeHandle
nativeObject,
QUIC_PARAM_LEVEL
level, uint param)
9
{
10
uint bufferLength = (uint)
sizeof
(
MsQuicNativeMethods
.
SOCKADDR_INET
);
11
Unsafe
.SkipInit(out
MsQuicNativeMethods
.
SOCKADDR_INET
result);
12
uint status = api.
GetParamDelegate
(nativeObject, level, param, ref bufferLength, (
byte
*)(&result));
13
QuicExceptionHelpers
.
ThrowIfFailed
(status,
"GetINETParam failed."
);
14
return
result;
15
}
16
17
internal
unsafe
static
ushort
GetUShortParam
(
MsQuicApi
api,
SafeHandle
nativeObject,
QUIC_PARAM_LEVEL
level, uint param)
18
{
19
uint bufferLength = 2u;
20
Unsafe
.SkipInit(out ushort result);
21
uint status = api.
GetParamDelegate
(nativeObject, level, param, ref bufferLength, (
byte
*)(&result));
22
QuicExceptionHelpers
.
ThrowIfFailed
(status,
"GetUShortParam failed."
);
23
return
result;
24
}
25
26
internal
unsafe
static
ulong
GetULongParam
(
MsQuicApi
api,
SafeHandle
nativeObject,
QUIC_PARAM_LEVEL
level, uint param)
27
{
28
uint bufferLength = 8u;
29
Unsafe
.SkipInit(out ulong result);
30
uint status = api.
GetParamDelegate
(nativeObject, level, param, ref bufferLength, (
byte
*)(&result));
31
QuicExceptionHelpers
.
ThrowIfFailed
(status,
"GetULongParam failed."
);
32
return
result;
33
}
34
}
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicApi.GetParamDelegate
MsQuicNativeMethods.GetParamDelegate GetParamDelegate
Definition
MsQuicApi.cs:63
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicApi
Definition
MsQuicApi.cs:8
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicNativeMethods
Definition
MsQuicNativeMethods.cs:6
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicParameterHelpers.GetULongParam
static unsafe ulong GetULongParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
Definition
MsQuicParameterHelpers.cs:26
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicParameterHelpers.GetUShortParam
static unsafe ushort GetUShortParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
Definition
MsQuicParameterHelpers.cs:17
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicParameterHelpers.GetINetParam
static unsafe MsQuicNativeMethods.SOCKADDR_INET GetINetParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
Definition
MsQuicParameterHelpers.cs:8
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicParameterHelpers
Definition
MsQuicParameterHelpers.cs:7
System.Net.Quic.Implementations.MsQuic.Internal.QuicExceptionHelpers.ThrowIfFailed
static void ThrowIfFailed(uint status, string message=null, Exception innerException=null)
Definition
QuicExceptionHelpers.cs:5
System.Net.Quic.Implementations.MsQuic.Internal.QuicExceptionHelpers
Definition
QuicExceptionHelpers.cs:4
System.Runtime.CompilerServices.Unsafe
Definition
Unsafe.cs:6
System.Runtime.InteropServices.SafeHandle
Definition
SafeHandle.cs:7
System.Net.Quic.Implementations.MsQuic.Internal.QUIC_PARAM_LEVEL
QUIC_PARAM_LEVEL
Definition
QUIC_PARAM_LEVEL.cs:4
System.Net.Quic.Implementations.MsQuic.Internal
Definition
MsQuicAddressHelpers.cs:4
System.Runtime.CompilerServices
Definition
NullablePublicOnlyAttribute.cs:3
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
System.Net.Quic.Implementations.MsQuic.Internal.MsQuicNativeMethods.SOCKADDR_INET
Definition
MsQuicNativeMethods.cs:499
source
System.Net.Quic
System.Net.Quic.Implementations.MsQuic.Internal
MsQuicParameterHelpers.cs
Generated by
1.10.0