Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MsQuicParameterHelpers.cs
Go to the documentation of this file.
3
5
6internal 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}
MsQuicNativeMethods.GetParamDelegate GetParamDelegate
Definition MsQuicApi.cs:63
static unsafe ulong GetULongParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
static unsafe ushort GetUShortParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
static unsafe MsQuicNativeMethods.SOCKADDR_INET GetINetParam(MsQuicApi api, SafeHandle nativeObject, QUIC_PARAM_LEVEL level, uint param)
static void ThrowIfFailed(uint status, string message=null, Exception innerException=null)