using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices.ComTypes;
using System.Security;
using System.Threading;
using Mono.Interop;
namespace System.Runtime.InteropServices
{
/// Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks, and converting managed to unmanaged types, as well as other miscellaneous methods used when interacting with unmanaged code.
// Token: 0x0200032F RID: 815
[SuppressUnmanagedCodeSecurity]
public static class Marshal
{
// Token: 0x06002246 RID: 8774
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int AddRefInternal(IntPtr pUnk);
/// Increments the reference count on the specified interface.
/// The new value of the reference count on the parameter.
/// The interface reference count to increment.
///
///
///
// Token: 0x06002247 RID: 8775 RVA: 0x000798D8 File Offset: 0x00077AD8
public static int AddRef(IntPtr pUnk)
{
if (pUnk == IntPtr.Zero)
{
throw new ArgumentException("Value cannot be null.", "pUnk");
}
return Marshal.AddRefInternal(pUnk);
}
/// Allocates a block of memory of specified size from the COM task memory allocator.
/// An integer representing the address of the block of memory allocated. This memory must be released with .
/// The size of the block of memory to be allocated.
/// There is insufficient memory to satisfy the request.
///
///
///
// Token: 0x06002248 RID: 8776
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr AllocCoTaskMem(int cb);
/// Allocates memory from the process's unmanaged memory.
/// An to the newly allocated memory. This memory must be released using the method.
/// The number of bytes in memory required.
/// There is insufficient memory to satisfy the request.
///
///
///
// Token: 0x06002249 RID: 8777
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr AllocHGlobal(IntPtr cb);
/// Allocates memory from the unmanaged memory of the process.
/// An to the newly allocated memory. This memory must be released using the method.
/// The number of bytes in memory required.
/// There is insufficient memory to satisfy the request.
///
///
///
// Token: 0x0600224A RID: 8778 RVA: 0x0007990C File Offset: 0x00077B0C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static IntPtr AllocHGlobal(int cb)
{
return Marshal.AllocHGlobal((IntPtr)cb);
}
/// Gets an interface pointer identified by the specified moniker.
/// An object containing a reference to the interface pointer identified by the parameter. A moniker is a name, and in this case, the moniker is defined by an interface.
/// The moniker corresponding to the desired interface pointer.
/// An unrecognized HRESULT was returned by the unmanaged BindToMoniker method.
///
///
///
// Token: 0x0600224B RID: 8779 RVA: 0x0007991C File Offset: 0x00077B1C
[MonoTODO]
public static object BindToMoniker(string monikerName)
{
throw new NotImplementedException();
}
/// Changes the strength of a COM callable wrapper's (CCW) handle on the object it contains.
/// The object whose COM callable wrapper (CCW) holds a reference counted handle. The handle is strong if the reference count on the CCW is greater than zero; otherwise it is weak.
/// true to change the strength of the handle on the parameter to weak, regardless of its reference count; false to reset the handle strength on to be reference counted.
///
///
///
// Token: 0x0600224C RID: 8780 RVA: 0x00079924 File Offset: 0x00077B24
[MonoTODO]
public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak)
{
throw new NotImplementedException();
}
// Token: 0x0600224D RID: 8781
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void copy_to_unmanaged(Array source, int startIndex, IntPtr destination, int length);
// Token: 0x0600224E RID: 8782
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void copy_from_unmanaged(IntPtr source, int startIndex, Array destination, int length);
/// Copies data from a one-dimensional, managed 8-bit unsigned integer array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , , or is null.
///
///
///
// Token: 0x0600224F RID: 8783 RVA: 0x0007992C File Offset: 0x00077B2C
public static void Copy(byte[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed character array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , or is null.
///
///
///
// Token: 0x06002250 RID: 8784 RVA: 0x00079938 File Offset: 0x00077B38
public static void Copy(char[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed 16-bit signed integer array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , , or is null.
///
///
///
// Token: 0x06002251 RID: 8785 RVA: 0x00079944 File Offset: 0x00077B44
public static void Copy(short[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed 32-bit signed integer array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// or is null.
///
///
///
// Token: 0x06002252 RID: 8786 RVA: 0x00079950 File Offset: 0x00077B50
public static void Copy(int[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed 64-bit signed integer array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , , or is null.
///
///
///
// Token: 0x06002253 RID: 8787 RVA: 0x0007995C File Offset: 0x00077B5C
public static void Copy(long[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed single-precision floating-point number array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , , or is null.
///
///
///
// Token: 0x06002254 RID: 8788 RVA: 0x00079968 File Offset: 0x00077B68
public static void Copy(float[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed double-precision floating-point number array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// and are not valid.
///
/// , , , or is null.
///
///
///
// Token: 0x06002255 RID: 8789 RVA: 0x00079974 File Offset: 0x00077B74
public static void Copy(double[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from a one-dimensional, managed array to an unmanaged memory pointer.
/// The one-dimensional array to copy from.
/// The zero-based index into the array where Copy should start.
/// The memory pointer to copy to.
/// The number of array elements to copy.
///
/// , , , or is null.
// Token: 0x06002256 RID: 8790 RVA: 0x00079980 File Offset: 0x00077B80
public static void Copy(IntPtr[] source, int startIndex, IntPtr destination, int length)
{
Marshal.copy_to_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed 8-bit unsigned integer array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x06002257 RID: 8791 RVA: 0x0007998C File Offset: 0x00077B8C
public static void Copy(IntPtr source, byte[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed character array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x06002258 RID: 8792 RVA: 0x00079998 File Offset: 0x00077B98
public static void Copy(IntPtr source, char[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed 16-bit signed integer array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x06002259 RID: 8793 RVA: 0x000799A4 File Offset: 0x00077BA4
public static void Copy(IntPtr source, short[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed 32-bit signed integer array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x0600225A RID: 8794 RVA: 0x000799B0 File Offset: 0x00077BB0
public static void Copy(IntPtr source, int[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed 64-bit signed integer array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x0600225B RID: 8795 RVA: 0x000799BC File Offset: 0x00077BBC
public static void Copy(IntPtr source, long[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed single-precision floating-point number array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x0600225C RID: 8796 RVA: 0x000799C8 File Offset: 0x00077BC8
public static void Copy(IntPtr source, float[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed double-precision floating-point number array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
///
///
///
// Token: 0x0600225D RID: 8797 RVA: 0x000799D4 File Offset: 0x00077BD4
public static void Copy(IntPtr source, double[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Copies data from an unmanaged memory pointer to a managed array.
/// The memory pointer to copy from.
/// The array to copy to.
/// The zero-based index into the array where Copy should start.
/// The number of array elements to copy.
///
/// , , , or is null.
// Token: 0x0600225E RID: 8798 RVA: 0x000799E0 File Offset: 0x00077BE0
public static void Copy(IntPtr source, IntPtr[] destination, int startIndex, int length)
{
Marshal.copy_from_unmanaged(source, startIndex, destination, length);
}
/// Aggregates a managed object with the specified COM object.
/// The inner IUnknown pointer of the managed object.
/// The outer IUnknown pointer.
/// An object to aggregate.
// Token: 0x0600225F RID: 8799 RVA: 0x000799EC File Offset: 0x00077BEC
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o)
{
throw new NotImplementedException();
}
/// Wraps the specified COM object in an object of the specified type.
/// The newly wrapped object that is an instance of the desired type.
/// The object to be wrapped.
/// The of wrapper to create.
///
/// must derive from __ComObject.
/// The parameter is null.
///
/// cannot be converted to the destination type since it does not support all required interfaces.
///
///
///
// Token: 0x06002260 RID: 8800 RVA: 0x000799F4 File Offset: 0x00077BF4
public static object CreateWrapperOfType(object o, Type t)
{
__ComObject _ComObject = o as __ComObject;
if (_ComObject == null)
{
throw new ArgumentException("o must derive from __ComObject", "o");
}
if (t == null)
{
throw new ArgumentNullException("t");
}
Type[] interfaces = o.GetType().GetInterfaces();
foreach (Type type in interfaces)
{
if (type.IsImport && _ComObject.GetInterface(type) == IntPtr.Zero)
{
throw new InvalidCastException();
}
}
return ComInteropProxy.GetProxy(_ComObject.IUnknown, t).GetTransparentProxy();
}
/// Frees all substructures pointed to by the specified unmanaged memory block.
/// A pointer to an unmanaged block of memory.
/// Type of a formatted class. This provides the layout information necessary to delete the buffer in the parameter.
///
/// has an automatic layout. Use sequential or explicit instead.
///
///
///
// Token: 0x06002261 RID: 8801
[ComVisible(true)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void DestroyStructure(IntPtr ptr, Type structuretype);
/// Frees a BSTR using SysFreeString.
/// The address of the BSTR to be freed.
///
///
///
// Token: 0x06002262 RID: 8802
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void FreeBSTR(IntPtr ptr);
/// Frees a block of memory allocated by the unmanaged COM task memory allocator with .
/// The address of the memory to be freed.
///
///
///
// Token: 0x06002263 RID: 8803
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void FreeCoTaskMem(IntPtr ptr);
/// Frees memory previously allocated from the unmanaged memory of the process with .
/// The handle returned by the original matching call to .
///
///
///
// Token: 0x06002264 RID: 8804
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void FreeHGlobal(IntPtr hglobal);
// Token: 0x06002265 RID: 8805 RVA: 0x00079A94 File Offset: 0x00077C94
private static void ClearBSTR(IntPtr ptr)
{
int num = Marshal.ReadInt32(ptr, -4);
for (int i = 0; i < num; i++)
{
Marshal.WriteByte(ptr, i, 0);
}
}
/// Frees a BSTR pointer that was allocated using the method.
/// The address of the BSTR to free.
///
///
///
// Token: 0x06002266 RID: 8806 RVA: 0x00079AC4 File Offset: 0x00077CC4
public static void ZeroFreeBSTR(IntPtr s)
{
Marshal.ClearBSTR(s);
Marshal.FreeBSTR(s);
}
// Token: 0x06002267 RID: 8807 RVA: 0x00079AD4 File Offset: 0x00077CD4
private static void ClearAnsi(IntPtr ptr)
{
int num = 0;
while (Marshal.ReadByte(ptr, num) != 0)
{
Marshal.WriteByte(ptr, num, 0);
num++;
}
}
// Token: 0x06002268 RID: 8808 RVA: 0x00079B00 File Offset: 0x00077D00
private static void ClearUnicode(IntPtr ptr)
{
int num = 0;
while (Marshal.ReadInt16(ptr, num) != 0)
{
Marshal.WriteInt16(ptr, num, 0);
num += 2;
}
}
/// Frees an unmanaged string pointer that was allocated using the method.
/// The address of the unmanaged string to free.
///
///
///
// Token: 0x06002269 RID: 8809 RVA: 0x00079B2C File Offset: 0x00077D2C
public static void ZeroFreeCoTaskMemAnsi(IntPtr s)
{
Marshal.ClearAnsi(s);
Marshal.FreeCoTaskMem(s);
}
/// Frees an unmanaged string pointer that was allocated using the method.
/// The address of the unmanaged string to free.
// Token: 0x0600226A RID: 8810 RVA: 0x00079B3C File Offset: 0x00077D3C
public static void ZeroFreeCoTaskMemUnicode(IntPtr s)
{
Marshal.ClearUnicode(s);
Marshal.FreeCoTaskMem(s);
}
/// Frees an unmanaged string pointer that was allocated using the method.
/// The address of the unmanaged string to free.
///
///
///
// Token: 0x0600226B RID: 8811 RVA: 0x00079B4C File Offset: 0x00077D4C
public static void ZeroFreeGlobalAllocAnsi(IntPtr s)
{
Marshal.ClearAnsi(s);
Marshal.FreeHGlobal(s);
}
/// Frees an unmanaged string pointer that was allocated using the method.
/// The address of the unmanaged string to free.
// Token: 0x0600226C RID: 8812 RVA: 0x00079B5C File Offset: 0x00077D5C
public static void ZeroFreeGlobalAllocUnicode(IntPtr s)
{
Marshal.ClearUnicode(s);
Marshal.FreeHGlobal(s);
}
/// Returns the globally unique identifier (GUID) for the specified type, or generates a GUID using the algorithm used by the Type Library Exporter (Tlbexp.exe).
/// A for the specified type.
/// The to generate a GUID for.
///
///
///
// Token: 0x0600226D RID: 8813 RVA: 0x00079B6C File Offset: 0x00077D6C
public static Guid GenerateGuidForType(Type type)
{
return type.GUID;
}
/// Returns a programmatic identifier (ProgID) for the specified type.
/// The ProgID of the specified type.
/// The to get a ProgID for.
/// The parameter is not a class that can be create by COM. The class must be public, have a public default constructor, and be COM visible.
/// The parameter is null.
///
///
///
// Token: 0x0600226E RID: 8814 RVA: 0x00079B74 File Offset: 0x00077D74
[MonoTODO]
public static string GenerateProgIdForType(Type type)
{
throw new NotImplementedException();
}
/// Obtains a running instance of the specified object from the Running Object Table (ROT).
/// The object requested. You can cast this object to any COM interface that it supports.
/// The ProgID of the object being requested.
/// The object was not found.
///
///
///
// Token: 0x0600226F RID: 8815 RVA: 0x00079B7C File Offset: 0x00077D7C
[MonoTODO]
public static object GetActiveObject(string progID)
{
throw new NotImplementedException();
}
// Token: 0x06002270 RID: 8816
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetCCW(object o, Type T);
// Token: 0x06002271 RID: 8817 RVA: 0x00079B84 File Offset: 0x00077D84
private static IntPtr GetComInterfaceForObjectInternal(object o, Type T)
{
if (Marshal.IsComObject(o))
{
return ((__ComObject)o).GetInterface(T);
}
return Marshal.GetCCW(o, T);
}
/// Returns an interface pointer that represents the specified interface for an object.
/// The interface pointer representing the interface for the object.
/// The object providing the interface.
/// The of interface that is requested.
/// The parameter is not an interface.-or- The type is not visible to COM. -or-The parameter is a generic type.
/// The parameter does not support the requested interface.
/// The parameter is null-or- The parameter is null
///
///
///
// Token: 0x06002272 RID: 8818 RVA: 0x00079BA8 File Offset: 0x00077DA8
public static IntPtr GetComInterfaceForObject(object o, Type T)
{
IntPtr comInterfaceForObjectInternal = Marshal.GetComInterfaceForObjectInternal(o, T);
Marshal.AddRef(comInterfaceForObjectInternal);
return comInterfaceForObjectInternal;
}
/// Returns an interface pointer that represents the specified interface for an object, if the caller is in the same context as that object.
/// The interface pointer specified by that represents the interface for the specified object, or null if the caller is not in the same context as the object.
/// The object that provides the interface.
/// The of interface that is requested.
///
/// is not an interface.-or- The type is not visible to COM.
///
/// does not support the requested interface.
///
/// is null.-or- is null.
///
///
///
// Token: 0x06002273 RID: 8819 RVA: 0x00079BC8 File Offset: 0x00077DC8
[MonoTODO]
public static IntPtr GetComInterfaceForObjectInContext(object o, Type t)
{
throw new NotImplementedException();
}
/// Gets data referenced by the specified key from the specified COM object.
/// The data represented by the parameter in the internal hash table of the parameter.
/// The COM object containing the desired data.
/// The key in the internal hash table of to retrieve the data from.
///
/// is null.-or- is null.
///
/// is not a COM object.
///
///
///
// Token: 0x06002274 RID: 8820 RVA: 0x00079BD0 File Offset: 0x00077DD0
[MonoNotSupported("MSDN states user code should never need to call this method.")]
public static object GetComObjectData(object obj, object key)
{
throw new NotSupportedException("MSDN states user code should never need to call this method.");
}
// Token: 0x06002275 RID: 8821
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int GetComSlotForMethodInfoInternal(MemberInfo m);
/// Gets the virtual function table (VTBL) slot for a specified when exposed to COM.
/// The VTBL (also called v-table) slot identifier when it is exposed to COM.
/// A that represents an interface method.
/// The parameter is null.
/// The parameter is not a object.-or-The parameter is not an interface method.
///
///
///
// Token: 0x06002276 RID: 8822 RVA: 0x00079BDC File Offset: 0x00077DDC
public static int GetComSlotForMethodInfo(MemberInfo m)
{
if (m == null)
{
throw new ArgumentNullException("m");
}
if (!(m is MethodInfo))
{
throw new ArgumentException("The MemberInfo must be an interface method.", "m");
}
if (!m.DeclaringType.IsInterface)
{
throw new ArgumentException("The MemberInfo must be an interface method.", "m");
}
return Marshal.GetComSlotForMethodInfoInternal(m);
}
/// Gets the last slot in the virtual function table (VTBL) of a type when exposed to COM.
/// The last VTBL (also called v-table) slot of the interface when exposed to COM. If the parameter is a class, the returned VTBL slot is the last slot in the interface that is generated from the class.
/// A representing an interface or class.
///
///
///
// Token: 0x06002277 RID: 8823 RVA: 0x00079C3C File Offset: 0x00077E3C
[MonoTODO]
public static int GetEndComSlot(Type t)
{
throw new NotImplementedException();
}
/// Retrieves a code that identifies the type of the exception that occurred.
/// The type of the exception.
///
///
///
// Token: 0x06002278 RID: 8824 RVA: 0x00079C44 File Offset: 0x00077E44
[MonoTODO]
public static int GetExceptionCode()
{
throw new NotImplementedException();
}
/// Retrieves a computer-independent description of an exception, and information about the state that existed for the thread when the exception occurred.
/// An to an EXCEPTION_POINTERS structure.
///
///
///
// Token: 0x06002279 RID: 8825 RVA: 0x00079C4C File Offset: 0x00077E4C
[ComVisible(true)]
[MonoTODO]
public static IntPtr GetExceptionPointers()
{
throw new NotImplementedException();
}
/// Returns the instance handle (HINSTANCE) for the specified module.
/// The HINSTANCE for ; -1 if the module does not have an HINSTANCE.
/// The whose HINSTANCE is desired.
/// The parameter is null.
///
///
///
// Token: 0x0600227A RID: 8826 RVA: 0x00079C54 File Offset: 0x00077E54
public static IntPtr GetHINSTANCE(Module m)
{
if (m == null)
{
throw new ArgumentNullException("m");
}
return m.GetHINSTANCE();
}
/// Converts the specified exception to an HRESULT.
/// The HRESULT mapped to the supplied exception.
/// The to convert to an HRESULT.
///
///
///
// Token: 0x0600227B RID: 8827 RVA: 0x00079C70 File Offset: 0x00077E70
[MonoTODO("SetErrorInfo")]
public static int GetHRForException(Exception e)
{
return e.hresult;
}
/// Returns the HRESULT corresponding to the last error incurred by Win32 code executed using .
/// The HRESULT corresponding to the last Win32 error code.
///
///
///
// Token: 0x0600227C RID: 8828 RVA: 0x00079C78 File Offset: 0x00077E78
[MonoTODO]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static int GetHRForLastWin32Error()
{
throw new NotImplementedException();
}
// Token: 0x0600227D RID: 8829
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetIDispatchForObjectInternal(object o);
/// Returns an IDispatch interface from a managed object.
/// The IDispatch pointer for the parameter.
/// The object whose IDispatch interface is requested.
///
/// does not support the requested interface.
///
///
///
// Token: 0x0600227E RID: 8830 RVA: 0x00079C80 File Offset: 0x00077E80
public static IntPtr GetIDispatchForObject(object o)
{
IntPtr idispatchForObjectInternal = Marshal.GetIDispatchForObjectInternal(o);
Marshal.AddRef(idispatchForObjectInternal);
return idispatchForObjectInternal;
}
/// Returns an IDispatch interface pointer from a managed object, if the caller is in the same context as that object.
/// The IDispatch interface pointer for the parameter, or null if the caller is not in the same context as the specified object.
/// The object whose IDispatch interface is requested.
///
/// does not support the requested interface.
///
/// is null.
///
///
///
// Token: 0x0600227F RID: 8831 RVA: 0x00079C9C File Offset: 0x00077E9C
[MonoTODO]
public static IntPtr GetIDispatchForObjectInContext(object o)
{
throw new NotImplementedException();
}
/// Returns an ITypeInfo interface from a managed type.
/// The ITypeInfo pointer for the parameter.
/// The whose ITypeInfo interface is being requested.
///
/// is not a visible type to COM.
/// A type library is registered for the assembly that contains the type, but the type definition cannot be found.
///
///
///
// Token: 0x06002280 RID: 8832 RVA: 0x00079CA4 File Offset: 0x00077EA4
[MonoTODO]
public static IntPtr GetITypeInfoForType(Type t)
{
throw new NotImplementedException();
}
// Token: 0x06002281 RID: 8833
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetIUnknownForObjectInternal(object o);
/// Returns an IUnknown interface from a managed object.
/// The IUnknown pointer for the parameter.
/// The object whose IUnknown interface is requested.
///
///
///
// Token: 0x06002282 RID: 8834 RVA: 0x00079CAC File Offset: 0x00077EAC
public static IntPtr GetIUnknownForObject(object o)
{
IntPtr iunknownForObjectInternal = Marshal.GetIUnknownForObjectInternal(o);
Marshal.AddRef(iunknownForObjectInternal);
return iunknownForObjectInternal;
}
/// Returns an IUnknown interface from a managed object, if the caller is in the same context as that object.
/// The IUnknown pointer for the parameter, or null if the caller is not in the same context as the specified object.
/// The object whose IUnknown interface is requested.
///
///
///
// Token: 0x06002283 RID: 8835 RVA: 0x00079CC8 File Offset: 0x00077EC8
[MonoTODO]
public static IntPtr GetIUnknownForObjectInContext(object o)
{
throw new NotImplementedException();
}
/// Gets a pointer to a thunk that marshals a call from managed to unmanaged code.
/// A pointer to the thunk that will marshal a call from the parameter.
/// A pointer to the method to marshal.
/// A pointer to the method signature.
/// The number of bytes in .
///
///
///
// Token: 0x06002284 RID: 8836 RVA: 0x00079CD0 File Offset: 0x00077ED0
[Obsolete("This method has been deprecated")]
[MonoTODO]
public static IntPtr GetManagedThunkForUnmanagedMethodPtr(IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature)
{
throw new NotImplementedException();
}
/// Retrieves for the specified virtual function table (VTBL) slot.
/// The MemberInfo that represents the member at the specified VTBL (also called v-table) slot.
/// The type for which the MethodInfo is to be retrieved.
/// The VTBL slot.
/// On successful return, the type of the member. This is one of the enumeration members.
///
/// is not visible from COM.
///
///
///
// Token: 0x06002285 RID: 8837 RVA: 0x00079CD8 File Offset: 0x00077ED8
[MonoTODO]
public static MemberInfo GetMethodInfoForComSlot(Type t, int slot, ref ComMemberType memberType)
{
throw new NotImplementedException();
}
/// Converts an object to a COM VARIANT.
/// The object for which to get a COM VARIANT.
/// An to receive the VARIANT corresponding to the parameter.
/// The parameter is a generic type.
///
///
///
// Token: 0x06002286 RID: 8838 RVA: 0x00079CE0 File Offset: 0x00077EE0
public static void GetNativeVariantForObject(object obj, IntPtr pDstNativeVariant)
{
Variant variant = default(Variant);
variant.SetValue(obj);
Marshal.StructureToPtr(variant, pDstNativeVariant, false);
}
// Token: 0x06002287 RID: 8839
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern object GetObjectForCCW(IntPtr pUnk);
/// Returns an instance of a type that represents a COM object by a pointer to its IUnknown interface.
/// An object representing the specified unmanaged COM object.
/// A pointer to the IUnknown interface.
///
///
///
// Token: 0x06002288 RID: 8840 RVA: 0x00079D0C File Offset: 0x00077F0C
public static object GetObjectForIUnknown(IntPtr pUnk)
{
object obj = Marshal.GetObjectForCCW(pUnk);
if (obj == null)
{
ComInteropProxy proxy = ComInteropProxy.GetProxy(pUnk, typeof(__ComObject));
obj = proxy.GetTransparentProxy();
}
return obj;
}
/// Converts a COM VARIANT to an object.
/// An object corresponding to the parameter.
/// An containing a COM VARIANT.
///
/// is not a valid VARIANT type.
///
/// has an unsupported type.
///
///
///
// Token: 0x06002289 RID: 8841 RVA: 0x00079D40 File Offset: 0x00077F40
public static object GetObjectForNativeVariant(IntPtr pSrcNativeVariant)
{
return ((Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant))).GetValue();
}
/// Converts an array of COM VARIANTs to an array of objects.
/// An object array corresponding to .
/// An containing the first element of an array of COM VARIANTs.
/// The count of COM VARIANTs in .
///
/// cannot be a negative number.
///
///
///
// Token: 0x0600228A RID: 8842 RVA: 0x00079D6C File Offset: 0x00077F6C
public static object[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars)
{
if (cVars < 0)
{
throw new ArgumentOutOfRangeException("cVars", "cVars cannot be a negative number.");
}
object[] array = new object[cVars];
for (int i = 0; i < cVars; i++)
{
array[i] = Marshal.GetObjectForNativeVariant((IntPtr)(aSrcNativeVariant.ToInt64() + (long)(i * Marshal.SizeOf(typeof(Variant)))));
}
return array;
}
/// Gets the first slot in the virtual function table (VTBL) that contains user defined methods.
/// The first VTBL (also called v-table) slot that contains user defined methods. The first slot is 3 if the interface is IUnknown based, and 7 if the interface is IDispatch based.
/// A representing an interface.
///
/// is not visible from COM.
///
///
///
// Token: 0x0600228B RID: 8843 RVA: 0x00079DD4 File Offset: 0x00077FD4
[MonoTODO]
public static int GetStartComSlot(Type t)
{
throw new NotImplementedException();
}
/// Converts a fiber cookie into the corresponding instance.
/// A corresponding to the parameter.
/// An integer representing a fiber cookie.
/// The parameter is 0.
///
///
///
// Token: 0x0600228C RID: 8844 RVA: 0x00079DDC File Offset: 0x00077FDC
[MonoTODO]
[Obsolete("This method has been deprecated")]
public static Thread GetThreadFromFiberCookie(int cookie)
{
throw new NotImplementedException();
}
/// Returns a managed object of a specified type that represents a COM object.
/// An instance of the class corresponding to the object that represents the requested unmanaged COM object.
/// A pointer to the IUnknown interface of the unmanaged object.
/// The of the requested managed class.
///
/// is not attributed with .
///
///
///
// Token: 0x0600228D RID: 8845 RVA: 0x00079DE4 File Offset: 0x00077FE4
public static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t)
{
ComInteropProxy comInteropProxy = new ComInteropProxy(pUnk, t);
__ComObject _ComObject = (__ComObject)comInteropProxy.GetTransparentProxy();
foreach (Type type in t.GetInterfaces())
{
if ((type.Attributes & TypeAttributes.Import) == TypeAttributes.Import && _ComObject.GetInterface(type) == IntPtr.Zero)
{
return null;
}
}
return _ComObject;
}
/// Converts an ITypeInfo into a managed object.
/// A managed that represents the unmanaged ITypeInfo.
/// The ITypeInfo interface to marshal.
///
///
///
///
///
// Token: 0x0600228E RID: 8846 RVA: 0x00079E58 File Offset: 0x00078058
[MonoTODO]
public static Type GetTypeForITypeInfo(IntPtr piTypeInfo)
{
throw new NotImplementedException();
}
/// Retrieves the name of the type represented by an ITypeInfo.
/// The name of the type pointed to by the parameter.
/// A that represents an ITypeInfo pointer.
///
///
///
// Token: 0x0600228F RID: 8847 RVA: 0x00079E60 File Offset: 0x00078060
[Obsolete]
[MonoTODO]
public static string GetTypeInfoName(UCOMITypeInfo pTI)
{
throw new NotImplementedException();
}
/// Retrieves the name of the type represented by an ITypeInfo.
/// The name of the type pointed to by the parameter.
/// A object that represents an ITypeInfo pointer.
/// The parameter is null.
///
///
///
// Token: 0x06002290 RID: 8848 RVA: 0x00079E68 File Offset: 0x00078068
public static string GetTypeInfoName(ITypeInfo typeInfo)
{
throw new NotImplementedException();
}
/// Retrieves the library identifier (LIBID) of a type library.
/// The LIBID (that is, the ) of the type library pointed to by the parameter.
/// A that represents an ITypeLib pointer.
///
///
///
// Token: 0x06002291 RID: 8849 RVA: 0x00079E70 File Offset: 0x00078070
[Obsolete]
[MonoTODO]
public static Guid GetTypeLibGuid(UCOMITypeLib pTLB)
{
throw new NotImplementedException();
}
/// Retrieves the library identifier (LIBID) of a type library.
/// The LIBID (that is, the ) of the type library pointed to by the parameter.
/// An object that represents an ITypeLib pointer.
///
///
///
// Token: 0x06002292 RID: 8850 RVA: 0x00079E78 File Offset: 0x00078078
[MonoTODO]
public static Guid GetTypeLibGuid(ITypeLib typelib)
{
throw new NotImplementedException();
}
/// Retrieves the library identifier (LIBID) that is assigned to a type library when it was exported from the specified assembly.
/// The LIBID (that is, the ) that is assigned to a type library when it is exported from the parameter.
/// A managed .
///
///
///
// Token: 0x06002293 RID: 8851 RVA: 0x00079E80 File Offset: 0x00078080
[MonoTODO]
public static Guid GetTypeLibGuidForAssembly(Assembly asm)
{
throw new NotImplementedException();
}
/// Retrieves the LCID of a type library.
/// The LCID of the type library pointed to by the parameter.
/// A that represents an ITypeLib pointer.
///
///
///
// Token: 0x06002294 RID: 8852 RVA: 0x00079E88 File Offset: 0x00078088
[Obsolete]
[MonoTODO]
public static int GetTypeLibLcid(UCOMITypeLib pTLB)
{
throw new NotImplementedException();
}
/// Retrieves the LCID of a type library.
/// The LCID of the type library pointed to by the parameter.
/// A object that represents an ITypeLib pointer.
///
///
///
// Token: 0x06002295 RID: 8853 RVA: 0x00079E90 File Offset: 0x00078090
[MonoTODO]
public static int GetTypeLibLcid(ITypeLib typelib)
{
throw new NotImplementedException();
}
/// Retrieves the name of a type library.
/// The name of the type library pointed to by the parameter.
/// A that represents an ITypeLib pointer.
///
///
///
// Token: 0x06002296 RID: 8854 RVA: 0x00079E98 File Offset: 0x00078098
[MonoTODO]
[Obsolete]
public static string GetTypeLibName(UCOMITypeLib pTLB)
{
throw new NotImplementedException();
}
/// Retrieves the name of a type library.
/// The name of the type library pointed to by the parameter.
/// An object that represents an ITypeLib pointer.
/// The parameter is null.
///
///
///
// Token: 0x06002297 RID: 8855 RVA: 0x00079EA0 File Offset: 0x000780A0
[MonoTODO]
public static string GetTypeLibName(ITypeLib typelib)
{
throw new NotImplementedException();
}
/// Retrieves the version number of a type library that will be exported from the specified assembly.
/// A managed object.
/// The major version number.
/// The minor version number.
///
///
///
// Token: 0x06002298 RID: 8856 RVA: 0x00079EA8 File Offset: 0x000780A8
[MonoTODO]
public static void GetTypeLibVersionForAssembly(Assembly inputAssembly, out int majorVersion, out int minorVersion)
{
throw new NotImplementedException();
}
/// Creates a unique runtime callable wrapper (RCW) object for a given IUnknown.
/// A unique runtime callable wrapper (RCW) for a given IUnknown.
/// A managed pointer to an IUnknown.
// Token: 0x06002299 RID: 8857 RVA: 0x00079EB0 File Offset: 0x000780B0
public static object GetUniqueObjectForIUnknown(IntPtr unknown)
{
throw new NotImplementedException();
}
/// Gets a pointer to a thunk that marshals a call from unmanaged to managed code.
/// A pointer to the thunk that will marshal a call from .
/// A pointer to the method to marshal.
/// A pointer to the method signature.
/// The number of bytes in .
///
///
///
// Token: 0x0600229A RID: 8858 RVA: 0x00079EB8 File Offset: 0x000780B8
[MonoTODO]
[Obsolete("This method has been deprecated")]
public static IntPtr GetUnmanagedThunkForManagedMethodPtr(IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature)
{
throw new NotImplementedException();
}
/// Indicates whether a specified object represents a COM object.
/// true if the parameter is a COM type; otherwise, false.
/// The object to check.
///
///
///
// Token: 0x0600229B RID: 8859
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool IsComObject(object o);
/// Indicates whether a type is visible to COM clients.
/// true if the type is visible to COM; otherwise, false.
/// The to check for COM visibility.
///
///
///
// Token: 0x0600229C RID: 8860 RVA: 0x00079EC0 File Offset: 0x000780C0
[MonoTODO]
public static bool IsTypeVisibleFromCom(Type t)
{
throw new NotImplementedException();
}
/// Calculates the number of bytes in unmanaged memory that are required to hold the parameters for the specified method.
/// The number of bytes required to represent the method parameters in unmanaged memory.
/// A that identifies the method to be checked.
/// The parameter is null.
/// The parameter is not a object.
///
///
///
// Token: 0x0600229D RID: 8861 RVA: 0x00079EC8 File Offset: 0x000780C8
[MonoTODO]
public static int NumParamBytes(MethodInfo m)
{
throw new NotImplementedException();
}
/// Returns the error code returned by the last unmanaged function called using platform invoke that has the flag set.
/// The last error code set by a call to the Win32 SetLastError API method.
///
///
///
// Token: 0x0600229E RID: 8862
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int GetLastWin32Error();
/// Returns the field offset of the unmanaged form of the managed class.
/// The offset, in bytes, for the parameter within the platform invoke declared class .
/// A , specifying the specified class. You must apply the to the class.
/// The field within the parameter.
/// The class cannot be exported as a structure or the field is nonpublic. Beginning with the .NET Framework version 2.0, the field may be private.
/// The parameter is null.
///
///
///
// Token: 0x0600229F RID: 8863
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr OffsetOf(Type t, string fieldName);
/// Executes one-time method setup tasks without calling the method.
/// A that identifies the method to be checked.
/// The parameter is null.
/// The parameter is not a object.
///
///
///
// Token: 0x060022A0 RID: 8864
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void Prelink(MethodInfo m);
/// Performs a pre-link check for all methods on a class.
/// A that identifies the class whose methods are to be checked.
/// The parameter is null.
///
///
///
// Token: 0x060022A1 RID: 8865
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void PrelinkAll(Type c);
/// Copies all characters up to the first null from an unmanaged ANSI string to a managed . Widens each ANSI character to Unicode.
/// A managed object that holds a copy of the unmanaged ANSI string. If is null, the method returns a null string.
/// The address of the first character of the unmanaged string.
///
///
///
// Token: 0x060022A2 RID: 8866
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string PtrToStringAnsi(IntPtr ptr);
/// Allocates a managed , copies a specified number of characters from an unmanaged ANSI string into it, and widens each ANSI character to Unicode.
/// A managed that holds a copy of the native ANSI string if the value of the parameter is not null; otherwise, this method returns null.
/// The address of the first character of the unmanaged string.
/// The byte count of the input string to copy.
///
/// is less than zero.
///
///
///
// Token: 0x060022A3 RID: 8867
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string PtrToStringAnsi(IntPtr ptr, int len);
/// Allocates a managed and copies all characters up to the first null character from a string stored in unmanaged memory into it.
/// A managed string that holds a copy of the unmanaged string if the value of the parameter is not null; otherwise, this method returns null.
/// For Unicode platforms, the address of the first Unicode character.-or- For ANSI plaforms, the address of the first ANSI character.
///
///
///
// Token: 0x060022A4 RID: 8868 RVA: 0x00079ED0 File Offset: 0x000780D0
public static string PtrToStringAuto(IntPtr ptr)
{
return (Marshal.SystemDefaultCharSize != 2) ? Marshal.PtrToStringAnsi(ptr) : Marshal.PtrToStringUni(ptr);
}
/// Copies a specified number of characters from a string stored in unmanaged memory to a managed .
/// A managed string that holds a copy of the native string if the value of the parameter is not null; otherwise, this method returns null.
/// For Unicode platforms, the address of the first Unicode character.-or- For ANSI plaforms, the address of the first ANSI character.
/// The number of characters to copy.
///
/// is less than zero.
///
///
///
// Token: 0x060022A5 RID: 8869 RVA: 0x00079EF0 File Offset: 0x000780F0
public static string PtrToStringAuto(IntPtr ptr, int len)
{
return (Marshal.SystemDefaultCharSize != 2) ? Marshal.PtrToStringAnsi(ptr, len) : Marshal.PtrToStringUni(ptr, len);
}
/// Allocates a managed and copies all characters up to the first null character from an unmanaged Unicode string into it.
/// A managed string holding a copy of the native string if the value of the parameter is not null; otherwise, this method returns null.
/// The address of the first character of the unmanaged string.
///
///
///
// Token: 0x060022A6 RID: 8870
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string PtrToStringUni(IntPtr ptr);
/// Copies a specified number of characters from a Unicode string stored in native heap to a managed .
/// A managed string that holds a copy of the native string if the value of the parameter is not null; otherwise, this method returns null.
/// The address of the first character of the unmanaged string.
/// The number of Unicode characters to copy.
///
///
///
// Token: 0x060022A7 RID: 8871
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string PtrToStringUni(IntPtr ptr, int len);
/// Allocates a managed and copies a BSTR string stored in unmanaged memory into it.
/// A managed string that holds a copy of the native string if the value of the parameter is not null; otherwise, this method returns null.
/// The address of the first character of the unmanaged string.
///
///
///
// Token: 0x060022A8 RID: 8872
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string PtrToStringBSTR(IntPtr ptr);
/// Marshals data from an unmanaged block of memory to a managed object.
/// A pointer to an unmanaged block of memory.
/// The object to which the data is to be copied. This must be an instance of a formatted class.
/// Structure layout is not sequential or explicit.-or- Structure is a boxed value type.
///
///
///
///
// Token: 0x060022A9 RID: 8873
[ComVisible(true)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void PtrToStructure(IntPtr ptr, object structure);
/// Marshals data from an unmanaged block of memory to a newly allocated managed object of the specified type.
/// A managed object containing the data pointed to by the parameter.
/// A pointer to an unmanaged block of memory.
/// The of object to be created. This type object must represent a formatted class or a structure.
/// The parameter layout is not sequential or explicit. -or-The parameter is a generic type.
///
/// is null.
///
///
///
///
// Token: 0x060022AA RID: 8874
[ComVisible(true)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern object PtrToStructure(IntPtr ptr, Type structureType);
// Token: 0x060022AB RID: 8875
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int QueryInterfaceInternal(IntPtr pUnk, ref Guid iid, out IntPtr ppv);
/// Requests a pointer to a specified interface from a COM object.
/// An HRESULT that indicates the success or failure of the call.
/// The interface to be queried.
/// A , passed by reference, that is the interface identifier (IID) of the requested interface.
/// When this method returns, contains a reference to the returned interface.
///
///
///
// Token: 0x060022AC RID: 8876 RVA: 0x00079F10 File Offset: 0x00078110
public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv)
{
if (pUnk == IntPtr.Zero)
{
throw new ArgumentException("Value cannot be null.", "pUnk");
}
return Marshal.QueryInterfaceInternal(pUnk, ref iid, out ppv);
}
/// Reads a single byte from an unmanaged pointer.
/// The byte read from the parameter.
/// The address in unmanaged memory from which to read.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022AD RID: 8877 RVA: 0x00079F48 File Offset: 0x00078148
public static byte ReadByte(IntPtr ptr)
{
return Marshal.ReadByte(ptr, 0);
}
/// Reads a single byte at a given offset (or index) from an unmanaged pointer.
/// The byte read from the parameter.
/// The base address in unmanaged memory from which to read.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022AE RID: 8878
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern byte ReadByte(IntPtr ptr, int ofs);
/// Reads a single byte from an unmanaged pointer.
/// The byte read from the parameter.
/// The base address in unmanaged memory of the source object.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022AF RID: 8879 RVA: 0x00079F54 File Offset: 0x00078154
[MonoTODO]
public static byte ReadByte([MarshalAs(UnmanagedType.AsAny)] [In] object ptr, int ofs)
{
throw new NotImplementedException();
}
/// Reads a 16-bit signed integer from the unmanaged memory.
/// The 16-bit signed integer read from the parameter.
/// The address in unmanaged memory from which to read.
///
/// is not a recognized format. -or- is null.-or- is invalid.
///
///
///
// Token: 0x060022B0 RID: 8880 RVA: 0x00079F5C File Offset: 0x0007815C
public static short ReadInt16(IntPtr ptr)
{
return Marshal.ReadInt16(ptr, 0);
}
/// Reads a 16-bit signed integer from unmanaged memory.
/// The 16-bit signed integer read from .
/// The base address in unmanaged memory from which to read.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022B1 RID: 8881
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern short ReadInt16(IntPtr ptr, int ofs);
/// Reads a 16-bit signed integer from unmanaged memory.
/// The 16-bit signed integer read from the parameter.
/// The base address in unmanaged memory of the source object.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022B2 RID: 8882 RVA: 0x00079F68 File Offset: 0x00078168
[MonoTODO]
public static short ReadInt16([MarshalAs(UnmanagedType.AsAny)] [In] object ptr, int ofs)
{
throw new NotImplementedException();
}
/// Reads a 32-bit signed integer from unmanaged memory.
/// The 32-bit signed integer read from the parameter.
/// The address in unmanaged from which to read.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022B3 RID: 8883 RVA: 0x00079F70 File Offset: 0x00078170
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static int ReadInt32(IntPtr ptr)
{
return Marshal.ReadInt32(ptr, 0);
}
/// Reads a 32-bit signed integer from unmanaged memory.
/// The 32-bit signed integer read from the parameter.
/// The base address in unmanaged memory from which to read.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022B4 RID: 8884
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int ReadInt32(IntPtr ptr, int ofs);
/// Reads a 32-bit signed integer from unmanaged memory.
/// The 32-bit signed integer read from the parameter.
/// The base address in unmanaged memory of the source object.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022B5 RID: 8885 RVA: 0x00079F7C File Offset: 0x0007817C
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MonoTODO]
public static int ReadInt32([MarshalAs(UnmanagedType.AsAny)] [In] object ptr, int ofs)
{
throw new NotImplementedException();
}
/// Reads a 64-bit signed integer from unmanaged memory.
/// The 64-bit signed integer read from the parameter.
/// The address in unmanaged memory from which to read.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022B6 RID: 8886 RVA: 0x00079F84 File Offset: 0x00078184
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static long ReadInt64(IntPtr ptr)
{
return Marshal.ReadInt64(ptr, 0);
}
/// Reads a 64-bit signed integer from unmanaged memory.
/// The 64-bit signed integer read from the parameter.
/// The base address in unmanaged memory from which to read.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022B7 RID: 8887
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern long ReadInt64(IntPtr ptr, int ofs);
/// Reads a 64-bit signed integer from unmanaged memory.
/// The 64-bit signed integer read from the parameter.
/// The base address in unmanaged memory of the source object.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022B8 RID: 8888 RVA: 0x00079F90 File Offset: 0x00078190
[MonoTODO]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static long ReadInt64([MarshalAs(UnmanagedType.AsAny)] [In] object ptr, int ofs)
{
throw new NotImplementedException();
}
/// Reads a processor native sized integer from unmanaged memory.
/// The IntPtr read from the parameter.
/// The address in unmanaged memory from which to read.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022B9 RID: 8889 RVA: 0x00079F98 File Offset: 0x00078198
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static IntPtr ReadIntPtr(IntPtr ptr)
{
return Marshal.ReadIntPtr(ptr, 0);
}
/// Reads a processor native sized integer from unmanaged memory.
/// The IntPtr read from the parameter.
/// The base address in unmanaged memory from which to read.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022BA RID: 8890
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr ReadIntPtr(IntPtr ptr, int ofs);
/// Reads a processor native sized integer from unmanaged memory.
/// The IntPtr read from the parameter.
/// The base address in unmanaged memory of the source object.
/// An additional byte offset, added to the parameter before reading.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022BB RID: 8891 RVA: 0x00079FA4 File Offset: 0x000781A4
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MonoTODO]
public static IntPtr ReadIntPtr([MarshalAs(UnmanagedType.AsAny)] [In] object ptr, int ofs)
{
throw new NotImplementedException();
}
/// Resizes a block of memory previously allocated with .
/// An integer representing the address of the block of memory reallocated. This memory must be released with .
/// A pointer to memory allocated with .
/// The new size of the allocated block.
/// There is insufficient memory to satisfy the request.
///
///
///
// Token: 0x060022BC RID: 8892
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr ReAllocCoTaskMem(IntPtr pv, int cb);
/// Resizes a block of memory previously allocated with .
/// An to the reallocated memory. This memory must be released using .
/// A pointer to memory allocated with .
/// The new size of the allocated block. This is not a pointer; it is the byte count you are requesting, cast to type . If you pass a pointer, it is treated as a size.
/// There is insufficient memory to satisfy the request.
///
///
///
// Token: 0x060022BD RID: 8893
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr ReAllocHGlobal(IntPtr pv, IntPtr cb);
// Token: 0x060022BE RID: 8894
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int ReleaseInternal(IntPtr pUnk);
/// Decrements the reference count on the specified interface.
/// The new value of the reference count on the interface specified by the parameter.
/// The interface to release.
///
///
///
// Token: 0x060022BF RID: 8895 RVA: 0x00079FAC File Offset: 0x000781AC
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static int Release(IntPtr pUnk)
{
if (pUnk == IntPtr.Zero)
{
throw new ArgumentException("Value cannot be null.", "pUnk");
}
return Marshal.ReleaseInternal(pUnk);
}
// Token: 0x060022C0 RID: 8896
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int ReleaseComObjectInternal(object co);
/// Decrements the reference count of the supplied runtime callable wrapper.
/// The new value of the reference count of the runtime callable wrapper associated with . This value is typically zero since the runtime callable wrapper keeps just one reference to the wrapped COM object regardless of the number of managed clients calling it.
/// The COM object to release.
///
/// is not a valid COM object.
///
/// is null.
///
///
///
// Token: 0x060022C1 RID: 8897 RVA: 0x00079FE0 File Offset: 0x000781E0
public static int ReleaseComObject(object o)
{
if (o == null)
{
throw new ArgumentException("Value cannot be null.", "o");
}
if (!Marshal.IsComObject(o))
{
throw new ArgumentException("Value must be a Com object.", "o");
}
return Marshal.ReleaseComObjectInternal(o);
}
/// Releases the thread cache.
///
///
///
// Token: 0x060022C2 RID: 8898 RVA: 0x0007A01C File Offset: 0x0007821C
[MonoTODO]
[Obsolete]
public static void ReleaseThreadCache()
{
throw new NotImplementedException();
}
/// Sets data referenced by the specified key in the specified COM object.
/// true if the data was set successfully; otherwise, false.
/// The COM object in which to store the data.
/// The key in the internal hash table of the COM object in which to store the data.
/// The data to set.
///
/// is null.-or- is null.
///
/// is not a COM object.
///
///
///
// Token: 0x060022C3 RID: 8899 RVA: 0x0007A024 File Offset: 0x00078224
[MonoNotSupported("MSDN states user code should never need to call this method.")]
public static bool SetComObjectData(object obj, object key, object data)
{
throw new NotSupportedException("MSDN states user code should never need to call this method.");
}
/// Returns the unmanaged size of an object in bytes.
/// The size of the parameter in unmanaged code.
/// The object whose size is to be returned.
/// The parameter is null.
///
///
///
// Token: 0x060022C4 RID: 8900 RVA: 0x0007A030 File Offset: 0x00078230
[ComVisible(true)]
public static int SizeOf(object structure)
{
return Marshal.SizeOf(structure.GetType());
}
/// Returns the size of an unmanaged type in bytes.
/// The size of the parameter in unmanaged code.
/// The whose size is to be returned.
/// The parameter is a generic type.
/// The parameter is null.
///
///
///
// Token: 0x060022C5 RID: 8901
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int SizeOf(Type t);
/// Allocates a BSTR and copies the contents of a managed into it.
/// An unmanaged pointer to the BSTR, or 0 if a null string was supplied.
/// The managed string to be copied.
/// There is insufficient memory available.
/// The length for is out of range.
///
///
///
// Token: 0x060022C6 RID: 8902
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr StringToBSTR(string s);
/// Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator.
/// An integer representing a pointer to the block of memory allocated for the string, or 0 if a null string was supplied.
/// A managed string to be copied.
/// There is insufficient memory available.
/// The parameter exceeds the maximum length allowed by the operating system.
///
///
///
// Token: 0x060022C7 RID: 8903 RVA: 0x0007A040 File Offset: 0x00078240
public static IntPtr StringToCoTaskMemAnsi(string s)
{
int num = s.Length + 1;
IntPtr intPtr = Marshal.AllocCoTaskMem(num);
byte[] array = new byte[num];
for (int i = 0; i < s.Length; i++)
{
array[i] = (byte)s[i];
}
array[s.Length] = 0;
Marshal.copy_to_unmanaged(array, 0, intPtr, num);
return intPtr;
}
/// Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator.
/// The allocated memory block, or 0 if a null string was supplied.
/// A managed string to be copied.
/// There is insufficient memory available.
/// The length for is out of range.
///
///
///
// Token: 0x060022C8 RID: 8904 RVA: 0x0007A09C File Offset: 0x0007829C
public static IntPtr StringToCoTaskMemAuto(string s)
{
return (Marshal.SystemDefaultCharSize != 2) ? Marshal.StringToCoTaskMemAnsi(s) : Marshal.StringToCoTaskMemUni(s);
}
/// Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator.
/// An integer representing a pointer to the block of memory allocated for the string, or 0 if a null string was supplied.
/// A managed string to be copied.
/// The parameter exceeds the maximum length allowed by the operating system.
/// There is insufficient memory available.
///
///
///
// Token: 0x060022C9 RID: 8905 RVA: 0x0007A0BC File Offset: 0x000782BC
public static IntPtr StringToCoTaskMemUni(string s)
{
int num = s.Length + 1;
IntPtr intPtr = Marshal.AllocCoTaskMem(num * 2);
char[] array = new char[num];
s.CopyTo(0, array, 0, s.Length);
array[s.Length] = '\0';
Marshal.copy_to_unmanaged(array, 0, intPtr, num);
return intPtr;
}
/// Copies the contents of a managed into unmanaged memory, converting into ANSI format as it copies.
/// The address, in unmanaged memory, to where was copied, or 0 if a null string was supplied.
/// A managed string to be copied.
/// There is insufficient memory available.
/// The parameter exceeds the maximum length allowed by the operating system.
///
///
///
// Token: 0x060022CA RID: 8906
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr StringToHGlobalAnsi(string s);
/// Copies the contents of a managed into unmanaged memory, converting into ANSI format if required.
/// The address, in unmanaged memory, to where the string was copied, or 0 if a null string was supplied.
/// A managed string to be copied.
/// There is insufficient memory available.
///
///
///
// Token: 0x060022CB RID: 8907 RVA: 0x0007A104 File Offset: 0x00078304
public static IntPtr StringToHGlobalAuto(string s)
{
return (Marshal.SystemDefaultCharSize != 2) ? Marshal.StringToHGlobalAnsi(s) : Marshal.StringToHGlobalUni(s);
}
/// Copies the contents of a managed into unmanaged memory.
/// The address, in unmanaged memory, to where the was copied, or 0 if a null string was supplied.
/// A managed string to be copied.
/// The method could not allocate enough native heap memory.
/// The parameter exceeds the maximum length allowed by the operating system.
///
///
///
// Token: 0x060022CC RID: 8908
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr StringToHGlobalUni(string s);
/// Allocates a BSTR and copies the contents of a managed object into it.
/// The address, in unmanaged memory, where the parameter was copied to, or 0 if a null object was supplied.
/// The managed object to be copied.
/// The parameter is null.
/// The current computer is not running Windows 2000 Service Pack 3 or later.
/// There is insufficient memory available.
///
///
///
// Token: 0x060022CD RID: 8909 RVA: 0x0007A124 File Offset: 0x00078324
public static IntPtr SecureStringToBSTR(SecureString s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
int length = s.Length;
IntPtr intPtr = Marshal.AllocCoTaskMem((length + 1) * 2 + 4);
byte[] array = null;
Marshal.WriteInt32(intPtr, 0, length * 2);
try
{
array = s.GetBuffer();
for (int i = 0; i < length; i++)
{
Marshal.WriteInt16(intPtr, 4 + i * 2, (short)(((int)array[i * 2] << 8) | (int)array[i * 2 + 1]));
}
Marshal.WriteInt16(intPtr, 4 + array.Length, 0);
}
finally
{
if (array != null)
{
int j = array.Length;
while (j > 0)
{
j--;
array[j] = 0;
}
}
}
return (IntPtr)((long)intPtr + 4L);
}
/// Copies the contents of a managed object to a block of memory allocated from the unmanaged COM task allocator.
/// The address, in unmanaged memory, where the parameter was copied to, or 0 if a null object was supplied.
/// The managed object to copy.
/// The parameter is null.
/// The current computer is not running Windows 2000 Service Pack 3 or later.
/// There is insufficient memory available.
///
///
///
// Token: 0x060022CE RID: 8910 RVA: 0x0007A1F8 File Offset: 0x000783F8
public static IntPtr SecureStringToCoTaskMemAnsi(SecureString s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
int length = s.Length;
IntPtr intPtr = Marshal.AllocCoTaskMem(length + 1);
byte[] array = new byte[length + 1];
try
{
byte[] buffer = s.GetBuffer();
int i = 0;
int num = 0;
while (i < length)
{
array[i] = buffer[num + 1];
buffer[num] = 0;
buffer[num + 1] = 0;
i++;
num += 2;
}
array[i] = 0;
Marshal.copy_to_unmanaged(array, 0, intPtr, length + 1);
}
finally
{
int j = length;
while (j > 0)
{
j--;
array[j] = 0;
}
}
return intPtr;
}
/// Copies the contents of a managed object to a block of memory allocated from the unmanaged COM task allocator.
/// The address, in unmanaged memory, where the parameter was copied to, or 0 if a null object was supplied.
/// The managed object to copy.
/// The parameter is null.
/// The current computer is not running Windows 2000 Service Pack 3 or later.
/// There is insufficient memory available.
// Token: 0x060022CF RID: 8911 RVA: 0x0007A2BC File Offset: 0x000784BC
public static IntPtr SecureStringToCoTaskMemUnicode(SecureString s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
int length = s.Length;
IntPtr intPtr = Marshal.AllocCoTaskMem(length * 2 + 2);
byte[] array = null;
try
{
array = s.GetBuffer();
for (int i = 0; i < length; i++)
{
Marshal.WriteInt16(intPtr, i * 2, (short)(((int)array[i * 2] << 8) | (int)array[i * 2 + 1]));
}
Marshal.WriteInt16(intPtr, array.Length, 0);
}
finally
{
if (array != null)
{
int j = array.Length;
while (j > 0)
{
j--;
array[j] = 0;
}
}
}
return intPtr;
}
/// Copies the contents of a managed into unmanaged memory, converting into ANSI format as it copies.
/// The address, in unmanaged memory, to where the parameter was copied, or 0 if a null was supplied.
/// The managed to be copied.
/// The parameter is null.
/// The current computer is not running Windows 2000 Service Pack 3 or later.
/// There is insufficient memory available.
///
///
///
// Token: 0x060022D0 RID: 8912 RVA: 0x0007A370 File Offset: 0x00078570
public static IntPtr SecureStringToGlobalAllocAnsi(SecureString s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
return Marshal.SecureStringToCoTaskMemAnsi(s);
}
/// Copies the contents of a managed object into unmanaged memory.
/// The address, in unmanaged memory, where was copied, or 0 if is a object whose length is 0.
/// The managed object to be copied.
/// The parameter is null.
/// The current computer is not running Windows 2000 Service Pack 3 or later.
/// There is insufficient memory available.
// Token: 0x060022D1 RID: 8913 RVA: 0x0007A38C File Offset: 0x0007858C
public static IntPtr SecureStringToGlobalAllocUnicode(SecureString s)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
return Marshal.SecureStringToCoTaskMemUnicode(s);
}
/// Marshals data from a managed object to an unmanaged block of memory.
/// A managed object holding the data to be marshaled. This object must be an instance of a formatted class.
/// A pointer to an unmanaged block of memory, which must be allocated before this method is called.
/// true to have the method called on the parameter before this method executes. Note that passing false can lead to a memory leak.
/// The parameter is a generic type.
///
///
///
// Token: 0x060022D2 RID: 8914
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
[ComVisible(true)]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void StructureToPtr(object structure, IntPtr ptr, bool fDeleteOld);
/// Throws an exception with a specific failure HRESULT value.
/// The HRESULT corresponding to the desired exception.
///
///
///
// Token: 0x060022D3 RID: 8915 RVA: 0x0007A3A8 File Offset: 0x000785A8
public static void ThrowExceptionForHR(int errorCode)
{
Exception exceptionForHR = Marshal.GetExceptionForHR(errorCode);
if (exceptionForHR != null)
{
throw exceptionForHR;
}
}
/// Throws an exception with a specific failure HRESULT.
/// The HRESULT corresponding to the desired exception.
/// A pointer to the IErrorInfo interface that provides more information about the error. You can specify IntPtr(0) to use the current IErrorInfo interface, or IntPtr(-1) to ignore the current IErrorInfo interface and construct the exception just from the error code.
///
///
///
// Token: 0x060022D4 RID: 8916 RVA: 0x0007A3C4 File Offset: 0x000785C4
public static void ThrowExceptionForHR(int errorCode, IntPtr errorInfo)
{
Exception exceptionForHR = Marshal.GetExceptionForHR(errorCode, errorInfo);
if (exceptionForHR != null)
{
throw exceptionForHR;
}
}
/// Gets the address of the element at the specified index inside the specified array.
/// The address of inside .
/// The containing the desired element.
/// The index in the parameter of the desired element.
///
///
///
// Token: 0x060022D5 RID: 8917
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index);
/// Writes a single byte value to unmanaged memory.
/// The address in unmanaged to write.
/// The value to write.
///
/// is not a recognized format. -or- is null.-or- is invalid.
///
///
///
// Token: 0x060022D6 RID: 8918 RVA: 0x0007A3E4 File Offset: 0x000785E4
public static void WriteByte(IntPtr ptr, byte val)
{
Marshal.WriteByte(ptr, 0, val);
}
/// Writes a single byte value to unmanaged memory.
/// The base address in unmanaged memory to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022D7 RID: 8919
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteByte(IntPtr ptr, int ofs, byte val);
/// Writes a single byte value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022D8 RID: 8920 RVA: 0x0007A3F0 File Offset: 0x000785F0
[MonoTODO]
public static void WriteByte([MarshalAs(UnmanagedType.AsAny)] [In] [Out] object ptr, int ofs, byte val)
{
throw new NotImplementedException();
}
/// Writes a 16-bit integer value to unmanaged memory.
/// The address in unmanaged memory to write.
/// The value to write.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022D9 RID: 8921 RVA: 0x0007A3F8 File Offset: 0x000785F8
public static void WriteInt16(IntPtr ptr, short val)
{
Marshal.WriteInt16(ptr, 0, val);
}
/// Writes a 16-bit signed integer value into unmanaged memory.
/// The base address in unmanaged memory to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022DA RID: 8922
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteInt16(IntPtr ptr, int ofs, short val);
/// Writes a 16-bit signed integer value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022DB RID: 8923 RVA: 0x0007A404 File Offset: 0x00078604
[MonoTODO]
public static void WriteInt16([MarshalAs(UnmanagedType.AsAny)] [In] [Out] object ptr, int ofs, short val)
{
throw new NotImplementedException();
}
/// Writes a 16-bit signed integer value to unmanaged memory.
/// The address in unmanaged memory to write.
/// The value to write.
///
/// is not a recognized format. -or- is null.-or- is invalid.
///
///
///
// Token: 0x060022DC RID: 8924 RVA: 0x0007A40C File Offset: 0x0007860C
public static void WriteInt16(IntPtr ptr, char val)
{
Marshal.WriteInt16(ptr, 0, val);
}
/// Writes a 16-bit signed integer value to unmanaged memory.
/// The base address in the native heap to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022DD RID: 8925
[MonoTODO]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteInt16(IntPtr ptr, int ofs, char val);
/// Writes a 16-bit signed integer value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022DE RID: 8926 RVA: 0x0007A418 File Offset: 0x00078618
[MonoTODO]
public static void WriteInt16([In] [Out] object ptr, int ofs, char val)
{
throw new NotImplementedException();
}
/// Writes a 32-bit signed integer value to unmanaged memory.
/// The address in unmanaged memory to write.
/// The value to write.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022DF RID: 8927 RVA: 0x0007A420 File Offset: 0x00078620
public static void WriteInt32(IntPtr ptr, int val)
{
Marshal.WriteInt32(ptr, 0, val);
}
/// Writes a 32-bit signed integer value into unmanaged memory.
/// The base address in unmanaged memory to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022E0 RID: 8928
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteInt32(IntPtr ptr, int ofs, int val);
/// Writes a 32-bit signed integer value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022E1 RID: 8929 RVA: 0x0007A42C File Offset: 0x0007862C
[MonoTODO]
public static void WriteInt32([MarshalAs(UnmanagedType.AsAny)] [In] [Out] object ptr, int ofs, int val)
{
throw new NotImplementedException();
}
/// Writes a 64-bit signed integer value to unmanaged memory.
/// The address in unmanaged memory to write.
/// The value to write.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022E2 RID: 8930 RVA: 0x0007A434 File Offset: 0x00078634
public static void WriteInt64(IntPtr ptr, long val)
{
Marshal.WriteInt64(ptr, 0, val);
}
/// Writes a 64-bit signed integer value to unmanaged memory.
/// The base address in unmanaged memory to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022E3 RID: 8931
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteInt64(IntPtr ptr, int ofs, long val);
/// Writes a 64-bit signed integer value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022E4 RID: 8932 RVA: 0x0007A440 File Offset: 0x00078640
[MonoTODO]
public static void WriteInt64([MarshalAs(UnmanagedType.AsAny)] [In] [Out] object ptr, int ofs, long val)
{
throw new NotImplementedException();
}
/// Writes a processor native sized integer value into unmanaged memory.
/// The address in unmanaged memory to write.
/// The value to write.
///
/// is not a recognized format. -or- is null. -or- is invalid.
///
///
///
// Token: 0x060022E5 RID: 8933 RVA: 0x0007A448 File Offset: 0x00078648
public static void WriteIntPtr(IntPtr ptr, IntPtr val)
{
Marshal.WriteIntPtr(ptr, 0, val);
}
/// Writes a processor native sized integer value to unmanaged memory.
/// The base address in unmanaged memory to write.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
///
///
// Token: 0x060022E6 RID: 8934
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void WriteIntPtr(IntPtr ptr, int ofs, IntPtr val);
/// Writes a processor native sized integer value to unmanaged memory.
/// The base address in unmanaged memory of the target object.
/// An additional byte offset, added to the parameter before writing.
/// The value to write.
/// Base address () plus offset byte () produces a null or invalid address.
///
/// is an object. This method does not accept parameters.
///
///
///
// Token: 0x060022E7 RID: 8935 RVA: 0x0007A454 File Offset: 0x00078654
[MonoTODO]
public static void WriteIntPtr([MarshalAs(UnmanagedType.AsAny)] [In] [Out] object ptr, int ofs, IntPtr val)
{
throw new NotImplementedException();
}
/// Converts the specified HRESULT error code to a corresponding object.
/// An object representing the converted HRESULT.
/// The HRESULT to be converted.
///
///
///
// Token: 0x060022E8 RID: 8936 RVA: 0x0007A45C File Offset: 0x0007865C
public static Exception GetExceptionForHR(int errorCode)
{
return Marshal.GetExceptionForHR(errorCode, IntPtr.Zero);
}
/// Converts the specified HRESULT error code to a corresponding object, with additional error information passed in an IErrorInfo interface for the exception object.
/// An object representing the converted HRESULT and information obtained from .
/// The HRESULT to be converted.
/// A pointer to the IErrorInfo interface that provides more information about the error. You can specify IntPtr(0) to use the current IErrorInfo interface, or IntPtr(-1) to ignore the current IErrorInfo interface and construct the exception just from the error code.
///
///
///
// Token: 0x060022E9 RID: 8937 RVA: 0x0007A46C File Offset: 0x0007866C
public static Exception GetExceptionForHR(int errorCode, IntPtr errorInfo)
{
if (errorCode == -2147024882)
{
return new OutOfMemoryException();
}
if (errorCode == -2147024809)
{
return new ArgumentException();
}
if (errorCode < 0)
{
return new COMException(string.Empty, errorCode);
}
return null;
}
/// Releases all references to a runtime callable wrapper (RCW) by setting the reference count of the supplied RCW to 0.
/// The new value of the reference count of the RCW associated with the parameter, which is zero if the release is successful.
/// The RCW to be released.
///
/// is not a valid COM object.
///
/// is null.
///
///
///
// Token: 0x060022EA RID: 8938 RVA: 0x0007A4B8 File Offset: 0x000786B8
public static int FinalReleaseComObject(object o)
{
while (Marshal.ReleaseComObject(o) != 0)
{
}
return 0;
}
// Token: 0x060022EB RID: 8939
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Delegate GetDelegateForFunctionPointerInternal(IntPtr ptr, Type t);
/// Converts an unmanaged function pointer to a delegate.
/// A delegate instance that can be cast to the appropriate delegate type.
/// An type that is the unmanaged function pointer to be converted.
/// The type of the delegate to be returned.
/// The parameter is not a delegate or is generic.
/// The parameter is null.-or-The parameter is null.
///
///
///
// Token: 0x060022EC RID: 8940 RVA: 0x0007A4CC File Offset: 0x000786CC
public static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t)
{
if (t == null)
{
throw new ArgumentNullException("t");
}
if (!t.IsSubclassOf(typeof(MulticastDelegate)) || t == typeof(MulticastDelegate))
{
throw new ArgumentException("Type is not a delegate", "t");
}
if (ptr == IntPtr.Zero)
{
throw new ArgumentNullException("ptr");
}
return Marshal.GetDelegateForFunctionPointerInternal(ptr, t);
}
// Token: 0x060022ED RID: 8941
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetFunctionPointerForDelegateInternal(Delegate d);
/// Converts a delegate into a function pointer callable from unmanaged code.
/// An value that can be passed to unmanaged code, which in turn can use it to call the underlying managed delegate.
/// The delegate to be passed to unmanaged code.
/// The parameter is a generic type
/// The parameter is null.
///
///
///
// Token: 0x060022EE RID: 8942 RVA: 0x0007A544 File Offset: 0x00078744
public static IntPtr GetFunctionPointerForDelegate(Delegate d)
{
if (d == null)
{
throw new ArgumentNullException("d");
}
return Marshal.GetFunctionPointerForDelegateInternal(d);
}
/// Represents the maximum size of a double byte character set (DBCS) size, in bytes, for the current operating system. This field is read-only.
// Token: 0x04000D6C RID: 3436
public static readonly int SystemMaxDBCSCharSize = 2;
/// Represents the default character size on the system; the default is 2 for Unicode systems and 1 for ANSI systems. This field is read-only.
// Token: 0x04000D6D RID: 3437
public static readonly int SystemDefaultCharSize = ((Environment.OSVersion.Platform != PlatformID.Win32NT) ? 1 : 2);
}
}