380 lines
20 KiB
C#
380 lines
20 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace System.IO
|
|
{
|
|
/// <summary>Provides access to unmanaged blocks of memory from managed code.</summary>
|
|
// Token: 0x020002B0 RID: 688
|
|
[Token(Token = "0x20002B0")]
|
|
public class UnmanagedMemoryStream : Stream
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.IO.UnmanagedMemoryStream" /> class.</summary>
|
|
/// <exception cref="T:System.Security.SecurityException">The user does not have the required permission.</exception>
|
|
// Token: 0x06001940 RID: 6464 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001940")]
|
|
[Address(RVA = "0xCD3E30", Offset = "0xCD2E30", VA = "0x180CD3E30")]
|
|
protected UnmanagedMemoryStream()
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.IO.UnmanagedMemoryStream" /> class using the specified location and memory length.</summary>
|
|
/// <param name="pointer">A pointer to an unmanaged memory location.</param>
|
|
/// <param name="length">The length of the memory to use.</param>
|
|
/// <exception cref="T:System.Security.SecurityException">The user does not have the required permission.</exception>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="pointer" /> value is <see langword="null" />.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="length" /> value is less than zero.
|
|
/// -or-
|
|
/// The <paramref name="length" /> is large enough to cause an overflow.</exception>
|
|
// Token: 0x06001941 RID: 6465 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001941")]
|
|
[Address(RVA = "0xCD3F30", Offset = "0xCD2F30", VA = "0x180CD3F30")]
|
|
[CLSCompliant(false)]
|
|
public unsafe UnmanagedMemoryStream(byte* pointer, long length)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06001942 RID: 6466 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001942")]
|
|
[Address(RVA = "0xCD3E90", Offset = "0xCD2E90", VA = "0x180CD3E90")]
|
|
internal unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access, bool skipSecurityCheck)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06001943 RID: 6467 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001943")]
|
|
[Address(RVA = "0xCD2780", Offset = "0xCD1780", VA = "0x180CD2780")]
|
|
internal unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access, bool skipSecurityCheck)
|
|
{
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether a stream supports reading.</summary>
|
|
/// <returns>
|
|
/// <see langword="false" /> if the object was created by a constructor with an <paramref name="access" /> parameter that did not include reading the stream and if the stream is closed; otherwise, <see langword="true" />.</returns>
|
|
// Token: 0x17000307 RID: 775
|
|
// (get) Token: 0x06001944 RID: 6468 RVA: 0x00010C08 File Offset: 0x0000EE08
|
|
[Token(Token = "0x17000307")]
|
|
public override bool CanRead
|
|
{
|
|
[Token(Token = "0x6001944")]
|
|
[Address(RVA = "0xCD3FD0", Offset = "0xCD2FD0", VA = "0x180CD3FD0", Slot = "7")]
|
|
get
|
|
{
|
|
return default(bool);
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether a stream supports seeking.</summary>
|
|
/// <returns>
|
|
/// <see langword="false" /> if the stream is closed; otherwise, <see langword="true" />.</returns>
|
|
// Token: 0x17000308 RID: 776
|
|
// (get) Token: 0x06001945 RID: 6469 RVA: 0x00010C20 File Offset: 0x0000EE20
|
|
[Token(Token = "0x17000308")]
|
|
public override bool CanSeek
|
|
{
|
|
[Token(Token = "0x6001945")]
|
|
[Address(RVA = "0x497580", Offset = "0x496580", VA = "0x180497580", Slot = "8")]
|
|
get
|
|
{
|
|
return default(bool);
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether a stream supports writing.</summary>
|
|
/// <returns>
|
|
/// <see langword="false" /> if the object was created by a constructor with an <paramref name="access" /> parameter value that supports writing or was created by a constructor that had no parameters, or if the stream is closed; otherwise, <see langword="true" />.</returns>
|
|
// Token: 0x17000309 RID: 777
|
|
// (get) Token: 0x06001946 RID: 6470 RVA: 0x00010C38 File Offset: 0x0000EE38
|
|
[Token(Token = "0x17000309")]
|
|
public override bool CanWrite
|
|
{
|
|
[Token(Token = "0x6001946")]
|
|
[Address(RVA = "0xCD3FE0", Offset = "0xCD2FE0", VA = "0x180CD3FE0", Slot = "9")]
|
|
get
|
|
{
|
|
return default(bool);
|
|
}
|
|
}
|
|
|
|
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.IO.UnmanagedMemoryStream" /> and optionally releases the managed resources.</summary>
|
|
/// <param name="disposing">
|
|
/// <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
|
|
// Token: 0x06001947 RID: 6471 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001947")]
|
|
[Address(RVA = "0xCD2650", Offset = "0xCD1650", VA = "0x180CD2650", Slot = "16")]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
}
|
|
|
|
/// <summary>Overrides the <see cref="M:System.IO.Stream.Flush" /> method so that no action is performed.</summary>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
// Token: 0x06001948 RID: 6472 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001948")]
|
|
[Address(RVA = "0xCD2760", Offset = "0xCD1760", VA = "0x180CD2760", Slot = "17")]
|
|
public override void Flush()
|
|
{
|
|
}
|
|
|
|
/// <summary>Overrides the <see cref="M:System.IO.Stream.FlushAsync(System.Threading.CancellationToken)" /> method so that the operation is cancelled if specified, but no other action is performed.
|
|
/// Available starting in .NET Framework 4.6</summary>
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
|
|
/// <returns>A task that represents the asynchronous flush operation.</returns>
|
|
// Token: 0x06001949 RID: 6473 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x6001949")]
|
|
[Address(RVA = "0xCD2660", Offset = "0xCD1660", VA = "0x180CD2660", Slot = "18")]
|
|
[ComVisible(false)]
|
|
public override Task FlushAsync(CancellationToken cancellationToken)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>Gets the length of the data in a stream.</summary>
|
|
/// <returns>The length of the data in the stream.</returns>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
// Token: 0x1700030A RID: 778
|
|
// (get) Token: 0x0600194A RID: 6474 RVA: 0x00010C50 File Offset: 0x0000EE50
|
|
[Token(Token = "0x1700030A")]
|
|
public override long Length
|
|
{
|
|
[Token(Token = "0x600194A")]
|
|
[Address(RVA = "0xCD4000", Offset = "0xCD3000", VA = "0x180CD4000", Slot = "10")]
|
|
get
|
|
{
|
|
return 0L;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the current position in a stream.</summary>
|
|
/// <returns>The current position in the stream.</returns>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The position is set to a value that is less than zero, or the position is larger than <see cref="F:System.Int32.MaxValue" /> or results in overflow when added to the current pointer.</exception>
|
|
// Token: 0x1700030B RID: 779
|
|
// (get) Token: 0x0600194B RID: 6475 RVA: 0x00010C68 File Offset: 0x0000EE68
|
|
// (set) Token: 0x0600194C RID: 6476 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x1700030B")]
|
|
public override long Position
|
|
{
|
|
[Token(Token = "0x600194B")]
|
|
[Address(RVA = "0xCD4110", Offset = "0xCD3110", VA = "0x180CD4110", Slot = "11")]
|
|
get
|
|
{
|
|
return 0L;
|
|
}
|
|
[Token(Token = "0x600194C")]
|
|
[Address(RVA = "0xCD4150", Offset = "0xCD3150", VA = "0x180CD4150", Slot = "12")]
|
|
set
|
|
{
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a byte pointer to a stream based on the current position in the stream.</summary>
|
|
/// <returns>A byte pointer.</returns>
|
|
/// <exception cref="T:System.IndexOutOfRangeException">The current position is larger than the capacity of the stream.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The position is being set is not a valid position in the current stream.</exception>
|
|
/// <exception cref="T:System.IO.IOException">The pointer is being set to a lower value than the starting position of the stream.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The stream was initialized for use with a <see cref="T:System.Runtime.InteropServices.SafeBuffer" />. The <see cref="P:System.IO.UnmanagedMemoryStream.PositionPointer" /> property is valid only for streams that are initialized with a <see cref="T:System.Byte" /> pointer.</exception>
|
|
// Token: 0x1700030C RID: 780
|
|
// (get) Token: 0x0600194D RID: 6477 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x1700030C")]
|
|
[CLSCompliant(false)]
|
|
public unsafe byte* PositionPointer
|
|
{
|
|
[Token(Token = "0x600194D")]
|
|
[Address(RVA = "0xCD4030", Offset = "0xCD3030", VA = "0x180CD4030")]
|
|
get
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <summary>Reads the specified number of bytes into the specified array.</summary>
|
|
/// <param name="buffer">When this method returns, contains the specified byte array with the values between <paramref name="offset" /> and (<paramref name="offset" /> + <paramref name="count" /> - 1) replaced by the bytes read from the current source. This parameter is passed uninitialized.</param>
|
|
/// <param name="offset">The zero-based byte offset in <paramref name="buffer" /> at which to begin storing the data read from the current stream.</param>
|
|
/// <param name="count">The maximum number of bytes to read from the current stream.</param>
|
|
/// <returns>The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.</returns>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The underlying memory does not support reading.
|
|
/// -or-
|
|
/// The <see cref="P:System.IO.UnmanagedMemoryStream.CanRead" /> property is set to <see langword="false" />.</exception>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is set to <see langword="null" />.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> parameter is less than zero.
|
|
/// -or-
|
|
/// The <paramref name="count" /> parameter is less than zero.</exception>
|
|
/// <exception cref="T:System.ArgumentException">The length of the buffer array minus the <paramref name="offset" /> parameter is less than the <paramref name="count" /> parameter.</exception>
|
|
// Token: 0x0600194E RID: 6478 RVA: 0x00010C80 File Offset: 0x0000EE80
|
|
[Token(Token = "0x600194E")]
|
|
[Address(RVA = "0xCD2DF0", Offset = "0xCD1DF0", VA = "0x180CD2DF0", Slot = "27")]
|
|
public override int Read([In] [Out] byte[] buffer, int offset, int count)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/// <summary>Asynchronously reads the specified number of bytes into the specified array.
|
|
/// Available starting in .NET Framework 4.6</summary>
|
|
/// <param name="buffer">The buffer to write the data into.</param>
|
|
/// <param name="offset">The byte offset in <paramref name="buffer" /> at which to begin writing data from the stream.</param>
|
|
/// <param name="count">The maximum number of bytes to read.</param>
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
|
|
/// <returns>A task that represents the asynchronous read operation. The value of the <paramref name="TResult" /> parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.</returns>
|
|
// Token: 0x0600194F RID: 6479 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x600194F")]
|
|
[Address(RVA = "0xCD29C0", Offset = "0xCD19C0", VA = "0x180CD29C0", Slot = "21")]
|
|
[ComVisible(false)]
|
|
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>Reads a byte from a stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.</summary>
|
|
/// <returns>The unsigned byte cast to an <see cref="T:System.Int32" /> object, or -1 if at the end of the stream.</returns>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The underlying memory does not support reading.
|
|
/// -or-
|
|
/// The current position is at the end of the stream.</exception>
|
|
// Token: 0x06001950 RID: 6480 RVA: 0x00010C98 File Offset: 0x0000EE98
|
|
[Token(Token = "0x6001950")]
|
|
[Address(RVA = "0xCD2C50", Offset = "0xCD1C50", VA = "0x180CD2C50", Slot = "28")]
|
|
public override int ReadByte()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/// <summary>Sets the current position of the current stream to the given value.</summary>
|
|
/// <param name="offset">The point relative to origin to begin seeking from.</param>
|
|
/// <param name="loc">Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type <see cref="T:System.IO.SeekOrigin" />.</param>
|
|
/// <returns>The new position in the stream.</returns>
|
|
/// <exception cref="T:System.IO.IOException">An attempt was made to seek before the beginning of the stream.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="offset" /> value is larger than the maximum size of the stream.</exception>
|
|
/// <exception cref="T:System.ArgumentException">
|
|
/// <paramref name="loc" /> is invalid.</exception>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
// Token: 0x06001951 RID: 6481 RVA: 0x00010CB0 File Offset: 0x0000EEB0
|
|
[Token(Token = "0x6001951")]
|
|
[Address(RVA = "0xCD3170", Offset = "0xCD2170", VA = "0x180CD3170", Slot = "25")]
|
|
public override long Seek(long offset, SeekOrigin loc)
|
|
{
|
|
return 0L;
|
|
}
|
|
|
|
/// <summary>Sets the length of a stream to a specified value.</summary>
|
|
/// <param name="value">The length of the stream.</param>
|
|
/// <exception cref="T:System.IO.IOException">An I/O error has occurred.</exception>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The underlying memory does not support writing.
|
|
/// -or-
|
|
/// An attempt is made to write to the stream and the <see cref="P:System.IO.UnmanagedMemoryStream.CanWrite" /> property is <see langword="false" />.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">The specified <paramref name="value" /> exceeds the capacity of the stream.
|
|
/// -or-
|
|
/// The specified <paramref name="value" /> is negative.</exception>
|
|
// Token: 0x06001952 RID: 6482 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001952")]
|
|
[Address(RVA = "0xCD3320", Offset = "0xCD2320", VA = "0x180CD3320", Slot = "26")]
|
|
public override void SetLength(long value)
|
|
{
|
|
}
|
|
|
|
/// <summary>Writes a block of bytes to the current stream using data from a buffer.</summary>
|
|
/// <param name="buffer">The byte array from which to copy bytes to the current stream.</param>
|
|
/// <param name="offset">The offset in the buffer at which to begin copying bytes to the current stream.</param>
|
|
/// <param name="count">The number of bytes to write to the current stream.</param>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The underlying memory does not support writing.
|
|
/// -or-
|
|
/// An attempt is made to write to the stream and the <see cref="P:System.IO.UnmanagedMemoryStream.CanWrite" /> property is <see langword="false" />.
|
|
/// -or-
|
|
/// The <paramref name="count" /> value is greater than the capacity of the stream.
|
|
/// -or-
|
|
/// The position is at the end of the stream capacity.</exception>
|
|
/// <exception cref="T:System.IO.IOException">An I/O error occurs.</exception>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">One of the specified parameters is less than zero.</exception>
|
|
/// <exception cref="T:System.ArgumentException">The <paramref name="offset" /> parameter minus the length of the <paramref name="buffer" /> parameter is less than the <paramref name="count" /> parameter.</exception>
|
|
/// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer" /> parameter is <see langword="null" />.</exception>
|
|
// Token: 0x06001953 RID: 6483 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001953")]
|
|
[Address(RVA = "0xCD39D0", Offset = "0xCD29D0", VA = "0x180CD39D0", Slot = "29")]
|
|
public override void Write(byte[] buffer, int offset, int count)
|
|
{
|
|
}
|
|
|
|
/// <summary>Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
|
|
/// Available starting in .NET Framework 4.6</summary>
|
|
/// <param name="buffer">The buffer to write data from.</param>
|
|
/// <param name="offset">The zero-based byte offset in <paramref name="buffer" /> from which to begin copying bytes to the stream.</param>
|
|
/// <param name="count">The maximum number of bytes to write.</param>
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
|
|
/// <returns>A task that represents the asynchronous write operation.</returns>
|
|
// Token: 0x06001954 RID: 6484 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x6001954")]
|
|
[Address(RVA = "0xCD34E0", Offset = "0xCD24E0", VA = "0x180CD34E0", Slot = "24")]
|
|
[ComVisible(false)]
|
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>Writes a byte to the current position in the file stream.</summary>
|
|
/// <param name="value">A byte value written to the stream.</param>
|
|
/// <exception cref="T:System.ObjectDisposedException">The stream is closed.</exception>
|
|
/// <exception cref="T:System.NotSupportedException">The underlying memory does not support writing.
|
|
/// -or-
|
|
/// An attempt is made to write to the stream and the <see cref="P:System.IO.UnmanagedMemoryStream.CanWrite" /> property is <see langword="false" />.
|
|
/// -or-
|
|
/// The current position is at the end of the capacity of the stream.</exception>
|
|
/// <exception cref="T:System.IO.IOException">The supplied <paramref name="value" /> causes the stream exceed its maximum capacity.</exception>
|
|
// Token: 0x06001955 RID: 6485 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6001955")]
|
|
[Address(RVA = "0xCD3740", Offset = "0xCD2740", VA = "0x180CD3740", Slot = "30")]
|
|
public override void WriteByte(byte value)
|
|
{
|
|
}
|
|
|
|
// Token: 0x04000D4D RID: 3405
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4000D4D")]
|
|
private SafeBuffer _buffer;
|
|
|
|
// Token: 0x04000D4E RID: 3406
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4000D4E")]
|
|
private unsafe byte* _mem;
|
|
|
|
// Token: 0x04000D4F RID: 3407
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4000D4F")]
|
|
private long _length;
|
|
|
|
// Token: 0x04000D50 RID: 3408
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4000D50")]
|
|
private long _capacity;
|
|
|
|
// Token: 0x04000D51 RID: 3409
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4000D51")]
|
|
private long _position;
|
|
|
|
// Token: 0x04000D52 RID: 3410
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4000D52")]
|
|
private long _offset;
|
|
|
|
// Token: 0x04000D53 RID: 3411
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4000D53")]
|
|
private FileAccess _access;
|
|
|
|
// Token: 0x04000D54 RID: 3412
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x5C")]
|
|
[Token(Token = "0x4000D54")]
|
|
internal bool _isOpen;
|
|
|
|
// Token: 0x04000D55 RID: 3413
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x4000D55")]
|
|
[NonSerialized]
|
|
private Task<int> _lastReadTask;
|
|
}
|
|
}
|