Ejemplo n.º 1
0
        internal static unsafe void SetULongParam(MsQuicApi api, IntPtr nativeObject, uint level, uint param, ulong value)
        {
            QuicBuffer buffer = new QuicBuffer()
            {
                Length = sizeof(ulong),
                Buffer = (byte *)&value
            };

            MsQuicStatusException.ThrowIfFailed(api.UnsafeGetParam(nativeObject, level, param, ref buffer));
        }
Ejemplo n.º 2
0
        internal static unsafe ulong GetULongParam(MsQuicApi api, IntPtr nativeObject, uint level, uint param)
        {
            byte *     ptr    = stackalloc byte[sizeof(ulong)];
            QuicBuffer buffer = new QuicBuffer()
            {
                Length = sizeof(ulong),
                Buffer = ptr
            };

            MsQuicStatusException.ThrowIfFailed(api.UnsafeGetParam(nativeObject, level, param, ref buffer));
            return(*(ulong *)ptr);
        }
Ejemplo n.º 3
0
        internal static unsafe SOCKADDR_INET GetINetParam(MsQuicApi api, IntPtr nativeObject, uint level, uint param)
        {
            byte *     ptr    = stackalloc byte[sizeof(SOCKADDR_INET)];
            QuicBuffer buffer = new QuicBuffer
            {
                Length = (uint)sizeof(SOCKADDR_INET),
                Buffer = ptr
            };

            MsQuicStatusException.ThrowIfFailed(api.UnsafeGetParam(nativeObject, level, param, ref buffer));

            return(*(SOCKADDR_INET *)ptr);
        }
        internal static unsafe ushort GetUShortParam(MsQuicApi api, IntPtr nativeObject, uint level, uint param)
        {
            byte *     ptr    = stackalloc byte[sizeof(ushort)];
            QuicBuffer buffer = new QuicBuffer()
            {
                Length = sizeof(ushort),
                Buffer = ptr
            };

            QuicExceptionHelpers.ThrowIfFailed(
                api.UnsafeGetParam(nativeObject, level, param, ref buffer),
                "Could not get ushort.");

            return(*(ushort *)ptr);
        }