Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Runtime.InteropServices.Marshal Class Reference

Public Member Functions

static int GetLastPInvokeError ()
 
static void SetLastPInvokeError (int error)
 
static IntPtr GetExceptionPointers ()
 
static int GetExceptionCode ()
 
static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld)
 
static void DestroyStructure (IntPtr ptr, Type structuretype)
 
static int GetHRForException (Exception? e)
 
static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t)
 
static void CleanupUnusedObjectsInCurrentContext ()
 
static bool AreComObjectsAvailableForCleanup ()
 
static bool IsTypeVisibleFromCom (Type t)
 
static int GetStartComSlot (Type t)
 
static int GetEndComSlot (Type t)
 
static void ChangeWrapperHandleStrength (object otp, bool fIsWeak)
 

Static Public Member Functions

static IntPtr OffsetOf (Type t, string fieldName)
 
static byte ReadByte (object ptr, int ofs)
 
static short ReadInt16 (object ptr, int ofs)
 
static int ReadInt32 (object ptr, int ofs)
 
static long ReadInt64 ([In][MarshalAs(UnmanagedType.AsAny)] object ptr, int ofs)
 
static void WriteByte (object ptr, int ofs, byte val)
 
static void WriteInt16 (object ptr, int ofs, short val)
 
static void WriteInt32 (object ptr, int ofs, int val)
 
static void WriteInt64 (object ptr, int ofs, long val)
 
static IntPtr GetHINSTANCE (Module m)
 
static string GetTypeInfoName (ITypeInfo typeInfo)
 
static IntPtr GetIUnknownForObject (object o)
 
static IntPtr GetIDispatchForObject (object o)
 
static IntPtr GetComInterfaceForObject (object o, Type T)
 
static IntPtr GetComInterfaceForObject< T, TInterface > ([DisallowNull] T o)
 
static IntPtr GetComInterfaceForObject (object o, Type T, CustomQueryInterfaceMode mode)
 
static object GetObjectForIUnknown (IntPtr pUnk)
 
static object GetUniqueObjectForIUnknown (IntPtr unknown)
 
static IntPtr CreateAggregatedObject (IntPtr pOuter, object o)
 
static IntPtr CreateAggregatedObject< T > (IntPtr pOuter, T o)
 
static bool IsComObject (object o)
 
static int ReleaseComObject (object o)
 
static int FinalReleaseComObject (object o)
 
static ? object GetComObjectData (object obj, object key)
 
static bool SetComObjectData (object obj, object key, object? data)
 
static ? object CreateWrapperOfType (object? o, Type t)
 
static TWrapper CreateWrapperOfType< T, TWrapper > (T? o)
 
static void GetNativeVariantForObject (object? obj, IntPtr pDstNativeVariant)
 
static void GetNativeVariantForObject< T > (T? obj, IntPtr pDstNativeVariant)
 
static ? object GetObjectForNativeVariant (IntPtr pSrcNativeVariant)
 
static ? T GetObjectForNativeVariant< T > (IntPtr pSrcNativeVariant)
 
static ? object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars)
 
static T[] GetObjectsForNativeVariants< T > (IntPtr aSrcNativeVariant, int cVars)
 
static object BindToMoniker (string monikerName)
 
static IntPtr AllocHGlobal (int cb)
 
static unsafe? string PtrToStringAnsi (IntPtr ptr)
 
static unsafe string PtrToStringAnsi (IntPtr ptr, int len)
 
static unsafe? string PtrToStringUni (IntPtr ptr)
 
static unsafe string PtrToStringUni (IntPtr ptr, int len)
 
static unsafe? string PtrToStringUTF8 (IntPtr ptr)
 
static unsafe string PtrToStringUTF8 (IntPtr ptr, int byteLen)
 
static int SizeOf (object structure)
 
static int SizeOf< T > (T structure)
 
static int SizeOf (Type t)
 
static int SizeOf< T > ()
 
static unsafe int QueryInterface (IntPtr pUnk, ref Guid iid, out IntPtr ppv)
 
static unsafe int AddRef (IntPtr pUnk)
 
static unsafe int Release (IntPtr pUnk)
 
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index)
 
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement< T > (T[] arr, int index)
 
static IntPtr OffsetOf< T > (string fieldName)
 
static void Copy (int[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (char[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (short[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (long[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (float[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (double[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (byte[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (IntPtr[] source, int startIndex, IntPtr destination, int length)
 
static void Copy (IntPtr source, int[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, char[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, short[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, long[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, float[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, double[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, byte[] destination, int startIndex, int length)
 
static void Copy (IntPtr source, IntPtr[] destination, int startIndex, int length)
 
static unsafe byte ReadByte (IntPtr ptr, int ofs)
 
static byte ReadByte (IntPtr ptr)
 
static unsafe short ReadInt16 (IntPtr ptr, int ofs)
 
static short ReadInt16 (IntPtr ptr)
 
static unsafe int ReadInt32 (IntPtr ptr, int ofs)
 
static int ReadInt32 (IntPtr ptr)
 
static IntPtr ReadIntPtr (object ptr, int ofs)
 
static IntPtr ReadIntPtr (IntPtr ptr, int ofs)
 
static IntPtr ReadIntPtr (IntPtr ptr)
 
static unsafe long ReadInt64 (IntPtr ptr, int ofs)
 
static long ReadInt64 (IntPtr ptr)
 
static unsafe void WriteByte (IntPtr ptr, int ofs, byte val)
 
static void WriteByte (IntPtr ptr, byte val)
 
static unsafe void WriteInt16 (IntPtr ptr, int ofs, short val)
 
static void WriteInt16 (IntPtr ptr, short val)
 
static void WriteInt16 (IntPtr ptr, int ofs, char val)
 
static void WriteInt16 ([In][Out] object ptr, int ofs, char val)
 
static void WriteInt16 (IntPtr ptr, char val)
 
static unsafe void WriteInt32 (IntPtr ptr, int ofs, int val)
 
static void WriteInt32 (IntPtr ptr, int val)
 
static void WriteIntPtr (IntPtr ptr, int ofs, IntPtr val)
 
static void WriteIntPtr (object ptr, int ofs, IntPtr val)
 
static void WriteIntPtr (IntPtr ptr, IntPtr val)
 
static unsafe void WriteInt64 (IntPtr ptr, int ofs, long val)
 
static void WriteInt64 (IntPtr ptr, long val)
 
static void Prelink (MethodInfo m)
 
static void PrelinkAll (Type c)
 
static void StructureToPtr< T > ([DisallowNull] T structure, IntPtr ptr, bool fDeleteOld)
 
static ? object PtrToStructure (IntPtr ptr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type structureType)
 
static void PtrToStructure (IntPtr ptr, object structure)
 
static void PtrToStructure< T > (IntPtr ptr, [DisallowNull] T structure)
 
static ? T PtrToStructure<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] T > (IntPtr ptr)
 
static void DestroyStructure< T > (IntPtr ptr)
 
static ? Exception GetExceptionForHR (int errorCode)
 
static ? Exception GetExceptionForHR (int errorCode, IntPtr errorInfo)
 
static void ThrowExceptionForHR (int errorCode)
 
static void ThrowExceptionForHR (int errorCode, IntPtr errorInfo)
 
static IntPtr SecureStringToBSTR (SecureString s)
 
static IntPtr SecureStringToCoTaskMemAnsi (SecureString s)
 
static IntPtr SecureStringToCoTaskMemUnicode (SecureString s)
 
static IntPtr SecureStringToGlobalAllocAnsi (SecureString s)
 
static IntPtr SecureStringToGlobalAllocUnicode (SecureString s)
 
static unsafe IntPtr StringToHGlobalAnsi (string? s)
 
static unsafe IntPtr StringToHGlobalUni (string? s)
 
static unsafe IntPtr StringToCoTaskMemUni (string? s)
 
static unsafe IntPtr StringToCoTaskMemUTF8 (string? s)
 
static unsafe IntPtr StringToCoTaskMemAnsi (string? s)
 
static Guid GenerateGuidForType (Type type)
 
static ? string GenerateProgIdForType (Type type)
 
static Delegate GetDelegateForFunctionPointer (IntPtr ptr, Type t)
 
static TDelegate GetDelegateForFunctionPointer< TDelegate > (IntPtr ptr)
 
static IntPtr GetFunctionPointerForDelegate (Delegate d)
 
static IntPtr GetFunctionPointerForDelegate< TDelegate > (TDelegate d)
 
static int GetHRForLastWin32Error ()
 
static unsafe void ZeroFreeBSTR (IntPtr s)
 
static void ZeroFreeCoTaskMemAnsi (IntPtr s)
 
static unsafe void ZeroFreeCoTaskMemUnicode (IntPtr s)
 
static unsafe void ZeroFreeCoTaskMemUTF8 (IntPtr s)
 
static unsafe void ZeroFreeGlobalAllocAnsi (IntPtr s)
 
static unsafe void ZeroFreeGlobalAllocUnicode (IntPtr s)
 
static unsafe IntPtr StringToBSTR (string? s)
 
static string PtrToStringBSTR (IntPtr ptr)
 
static ? Type GetTypeFromCLSID (Guid clsid)
 
static void InitHandle (SafeHandle safeHandle, IntPtr handle)
 
static int GetLastWin32Error ()
 
static ? string PtrToStringAuto (IntPtr ptr, int len)
 
static ? string PtrToStringAuto (IntPtr ptr)
 
static IntPtr StringToHGlobalAuto (string? s)
 
static IntPtr StringToCoTaskMemAuto (string? s)
 
static IntPtr AllocHGlobal (IntPtr cb)
 
static void FreeHGlobal (IntPtr hglobal)
 
static IntPtr ReAllocHGlobal (IntPtr pv, IntPtr cb)
 
static IntPtr AllocCoTaskMem (int cb)
 
static void FreeCoTaskMem (IntPtr ptr)
 
static IntPtr ReAllocCoTaskMem (IntPtr pv, int cb)
 
static void FreeBSTR (IntPtr ptr)
 
static int GetLastSystemError ()
 
static void SetLastSystemError (int error)
 

Static Public Attributes

static readonly int SystemDefaultCharSize = 2
 
static readonly int SystemMaxDBCSCharSize = GetSystemMaxDBCSCharSize()
 

Package Functions

static int SizeOfHelper (Type t, bool throwIfNotMarshalable)
 
static bool IsPinnable (object obj)
 
static Exception GetExceptionForHRInternal (int errorCode, IntPtr errorInfo)
 
static int InternalReleaseComObject (object o)
 
static void InternalFinalReleaseComObject (object o)
 
static Delegate GetDelegateForFunctionPointerInternal (IntPtr ptr, Type t)
 
static IntPtr GetFunctionPointerForDelegateInternal (Delegate d)
 

Static Package Functions

static Type GetTypeFromCLSID (Guid clsid, string server, bool throwOnError)
 
static unsafe uint SysStringByteLen (IntPtr s)
 
static unsafe int StringToAnsiString (string s, byte *buffer, int bufferLength, bool bestFit=false, bool throwOnUnmappableChar=false)
 
static unsafe int GetAnsiStringByteCount (ReadOnlySpan< char > chars)
 
static unsafe void GetAnsiStringBytes (ReadOnlySpan< char > chars, Span< byte > bytes)
 
static IntPtr AllocBSTR (int length)
 
static IntPtr AllocBSTRByteLen (uint length)
 
static Type GetTypeFromProgID (string progID, string server, bool throwOnError)
 

Static Package Attributes

static Guid IID_IUnknown = new Guid(0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70)
 

Properties

static bool IsBuiltInComSupported = IsBuiltInComSupportedInternal() [get]
 

Private Member Functions

static IntPtr OffsetOfHelper (IRuntimeFieldInfo f)
 
static void InternalPrelink (RuntimeMethodHandleInternal m)
 
static void PtrToStructureHelper (IntPtr ptr, object structure, bool allowValueClasses)
 
static bool IsBuiltInComSupportedInternal ()
 
static IntPtr GetHINSTANCE (QCallModule m)
 
static void GetTypeFromCLSID (in Guid clsid, string server, ObjectHandleOnStack retType)
 
static IntPtr GetIUnknownForObjectNative (object o)
 
static IntPtr GetIDispatchForObjectNative (object o)
 
static IntPtr GetComInterfaceForObjectNative (object o, Type t, bool fEnableCustomizedQueryInterface)
 
static object GetObjectForIUnknownNative (IntPtr pUnk)
 
static object GetUniqueObjectForIUnknownNative (IntPtr unknown)
 
static IntPtr CreateAggregatedObjectNative (IntPtr pOuter, object o)
 
static object InternalCreateWrapperOfType (object o, Type t)
 
static void GetNativeVariantForObjectNative (object obj, IntPtr pDstNativeVariant)
 
static object GetObjectForNativeVariantNative (IntPtr pSrcNativeVariant)
 
static object[] GetObjectsForNativeVariantsNative (IntPtr aSrcNativeVariant, int cVars)
 
static void CreateBindCtx (uint reserved, out IBindCtx ppbc)
 
static void MkParseDisplayName (IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IMoniker ppmk)
 
static void BindMoniker (IMoniker pmk, uint grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult)
 

Static Private Member Functions

static unsafe T ReadValueSlow< T > (object ptr, int ofs, Func< IntPtr, int, T > readValueHelper)
 
static unsafe void WriteValueSlow< T > (object ptr, int ofs, T val, Action< IntPtr, int, T > writeValueHelper)
 
static void PrelinkCore (MethodInfo m)
 
static unsafe void CopyToNative< T > (T[] source, int startIndex, IntPtr destination, int length)
 
static unsafe void CopyToManaged< T > (IntPtr source, T[] destination, int startIndex, int length)
 
static unsafe int GetSystemMaxDBCSCharSize ()
 
static bool IsNullOrWin32Atom (IntPtr ptr)
 

Detailed Description

Definition at line 13 of file Marshal.cs.


The documentation for this class was generated from the following file: