﻿<?xml version="1.0" encoding="utf-8"?><Type Name="SafeBuffer" FullName="System.Runtime.InteropServices.SafeBuffer"><TypeSignature Language="C#" Value="public abstract class SafeBuffer : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid" /><TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit SafeBuffer extends Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid implements class System.IDisposable" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid</BaseTypeName></Base><Interfaces /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>You must call the <see cref="Overload:System.Runtime.InteropServices.SafeBuffer.Initialize" /> method before you use any instance of <see cref="T:System.Runtime.InteropServices.SafeBuffer" />. To avoid races when you store an instance of a <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> object in a static variable, you should use one of the following approaches:</para><list type="bullet"><item><para>Create a lock when publishing the <see cref="T:System.Runtime.InteropServices.SafeBuffer" />.</para></item><item><para>Create a local variable, initialize the <see cref="T:System.Runtime.InteropServices.SafeBuffer" />, and then assign the <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> to the static variable, for example, by using the <see cref="M:System.Threading.Interlocked.CompareExchange``1(``0@,``0,``0)" /> method.</para></item></list><block subset="none" type="note"><para>Assignments in a static class constructor are implicitly locked.</para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Provides a controlled memory buffer that can be used for reading and writing. Attempts to access memory outside the controlled buffer (underruns and overruns) raise exceptions.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="protected SafeBuffer (bool ownsHandle);" /><MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(bool ownsHandle) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="ownsHandle" Type="System.Boolean" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Creates a new instance of the <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> class, and specifies whether the buffer handle is to be reliably released. </para></summary><param name="ownsHandle"><attribution license="cc4" from="Microsoft" modified="false" />true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).</param></Docs></Member><Member MemberName="AcquirePointer"><MemberSignature Language="C#" Value="public void AcquirePointer (ref byte* pointer);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AcquirePointer(unsigned int8* pointer) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="pointer" Type="System.Byte*&amp;" RefType="ref" /></Parameters><Docs><param name="pointer">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ByteLength"><MemberSignature Language="C#" Value="public ulong ByteLength { get; }" /><MemberSignature Language="ILAsm" Value=".property instance unsigned int64 ByteLength" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.UInt64</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the size of the buffer, in bytes.</para></summary></Docs></Member><Member MemberName="Initialize"><MemberSignature Language="C#" Value="public void Initialize (ulong numBytes);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Initialize(unsigned int64 numBytes) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="numBytes" Type="System.UInt64" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Defines the allocation size of the memory region in bytes. You must call this method before you use the <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> instance.</para></summary><param name="numBytes"><attribution license="cc4" from="Microsoft" modified="false" />The number of bytes in the buffer.</param></Docs></Member><Member MemberName="Initialize"><MemberSignature Language="C#" Value="public void Initialize (uint numElements, uint sizeOfEachElement);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Initialize(unsigned int32 numElements, unsigned int32 sizeOfEachElement) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="numElements" Type="System.UInt32" /><Parameter Name="sizeOfEachElement" Type="System.UInt32" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This method defines the required size of the memory region as the number of elements in an array multiplied by the size of each element.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Specifies the allocation size of the memory buffer by using the specified number of elements and element size. You must call this method before you use the <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> instance.</para></summary><param name="numElements"><attribution license="cc4" from="Microsoft" modified="false" />The number of elements in the buffer.</param><param name="sizeOfEachElement"><attribution license="cc4" from="Microsoft" modified="false" />The size of each element in the buffer.</param></Docs></Member><Member MemberName="Initialize&lt;T&gt;"><MemberSignature Language="C#" Value="public void Initialize&lt;T&gt; (uint numElements) where T : struct;" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Initialize&lt;struct .ctor (class System.ValueType) T&gt;(unsigned int32 numElements) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><TypeParameters><TypeParameter Name="T"><Constraints><ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute><ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute><BaseTypeName>System.ValueType</BaseTypeName></Constraints></TypeParameter></TypeParameters><Parameters><Parameter Name="numElements" Type="System.UInt32" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Defines the allocation size of the memory region by specifying the number of value types. You must call this method before you use the <see cref="T:System.Runtime.InteropServices.SafeBuffer" /> instance.</para></summary><param name="numElements"><attribution license="cc4" from="Microsoft" modified="false" />The number of elements of the value type to allocate memory for.</param><typeparam name="T"><attribution license="cc4" from="Microsoft" modified="false" />The value type to allocate memory for.</typeparam></Docs></Member><Member MemberName="Read&lt;T&gt;"><MemberSignature Language="C#" Value="public T Read&lt;T&gt; (ulong byteOffset) where T : struct;" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance !!T Read&lt;struct .ctor (class System.ValueType) T&gt;(unsigned int64 byteOffset) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>T</ReturnType></ReturnValue><TypeParameters><TypeParameter Name="T"><Constraints><ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute><ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute><BaseTypeName>System.ValueType</BaseTypeName></Constraints></TypeParameter></TypeParameters><Parameters><Parameter Name="byteOffset" Type="System.UInt64" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Reads a value type from memory at the specified offset.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>The value type that was read from memory.</para></returns><param name="byteOffset"><attribution license="cc4" from="Microsoft" modified="false" />The location from which to read the value type. You may have to consider alignment issues.</param><typeparam name="T"><attribution license="cc4" from="Microsoft" modified="false" />The value type to read.</typeparam></Docs></Member><Member MemberName="ReadArray&lt;T&gt;"><MemberSignature Language="C#" Value="public void ReadArray&lt;T&gt; (ulong byteOffset, T[] array, int index, int count) where T : struct;" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ReadArray&lt;struct .ctor (class System.ValueType) T&gt;(unsigned int64 byteOffset, !!T[] array, int32 index, int32 count) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><TypeParameters><TypeParameter Name="T"><Constraints><ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute><ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute><BaseTypeName>System.ValueType</BaseTypeName></Constraints></TypeParameter></TypeParameters><Parameters><Parameter Name="byteOffset" Type="System.UInt64" /><Parameter Name="array" Type="T[]" /><Parameter Name="index" Type="System.Int32" /><Parameter Name="count" Type="System.Int32" /></Parameters><Docs><typeparam name="T">To be added.</typeparam><param name="byteOffset">To be added.</param><param name="array">To be added.</param><param name="index">To be added.</param><param name="count">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ReleasePointer"><MemberSignature Language="C#" Value="public void ReleasePointer ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ReleasePointer() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>After this method returns, the pointer cannot be used.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Releases a pointer that was obtained by the <see cref="M:System.Runtime.InteropServices.SafeBuffer.AcquirePointer(System.Byte*@)" /> method.</para></summary></Docs></Member><Member MemberName="Write&lt;T&gt;"><MemberSignature Language="C#" Value="public void Write&lt;T&gt; (ulong byteOffset, T value) where T : struct;" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Write&lt;struct .ctor (class System.ValueType) T&gt;(unsigned int64 byteOffset, !!T value) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><TypeParameters><TypeParameter Name="T"><Constraints><ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute><ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute><BaseTypeName>System.ValueType</BaseTypeName></Constraints></TypeParameter></TypeParameters><Parameters><Parameter Name="byteOffset" Type="System.UInt64" /><Parameter Name="value" Type="T" /></Parameters><Docs><typeparam name="T">To be added.</typeparam><param name="byteOffset">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="WriteArray&lt;T&gt;"><MemberSignature Language="C#" Value="public void WriteArray&lt;T&gt; (ulong byteOffset, T[] array, int index, int count) where T : struct;" /><MemberSignature Language="ILAsm" Value=".method public hidebysig instance void WriteArray&lt;struct .ctor (class System.ValueType) T&gt;(unsigned int64 byteOffset, !!T[] array, int32 index, int32 count) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>System.CLSCompliant(false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><TypeParameters><TypeParameter Name="T"><Constraints><ParameterAttribute>DefaultConstructorConstraint</ParameterAttribute><ParameterAttribute>NotNullableValueTypeConstraint</ParameterAttribute><BaseTypeName>System.ValueType</BaseTypeName></Constraints></TypeParameter></TypeParameters><Parameters><Parameter Name="byteOffset" Type="System.UInt64" /><Parameter Name="array" Type="T[]" /><Parameter Name="index" Type="System.Int32" /><Parameter Name="count" Type="System.Int32" /></Parameters><Docs><typeparam name="T">To be added.</typeparam><param name="byteOffset">To be added.</param><param name="array">To be added.</param><param name="index">To be added.</param><param name="count">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member></Members></Type>