System.Net.SyncRequestContext.Allocate C# (CSharp) Метод

Allocate() приватный Метод

private Allocate ( int size ) : Interop.HttpApi.HTTP_REQUEST*
size int
Результат Interop.HttpApi.HTTP_REQUEST*
        private Interop.HttpApi.HTTP_REQUEST* Allocate(int size)
        {
            if (_pinnedHandle.IsAllocated)
            {
                if (RequestBuffer.Length == size)
                {
                    return RequestBlob;
                }
                _pinnedHandle.Free();
            }
            SetBuffer(size);
            if (RequestBuffer == null)
            {
                return null;
            }
            _pinnedHandle = GCHandle.Alloc(RequestBuffer, GCHandleType.Pinned);
            return (Interop.HttpApi.HTTP_REQUEST*)Marshal.UnsafeAddrOfPinnedArrayElement(RequestBuffer, 0);
        }