15 internal static Guid IID_IUnknown =
new Guid(0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70);
27 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2070:UnrecognizedReflectionPattern", Justification =
"Trimming doesn't affect types eligible for marshalling. Different exception for invalid inputs doesn't matter.")]
30 if ((
object)t ==
null)
35 if ((
object)field ==
null)
49 public static byte ReadByte(
object ptr,
int ofs)
69 private unsafe
static T
ReadValueSlow<T>(
object ptr,
int ofs, Func<IntPtr, int, T> readValueHelper)
81 return readValueHelper(intPtr, ofs);
89 public static void WriteByte(
object ptr,
int ofs,
byte val)
97 public static void WriteInt16(
object ptr,
int ofs,
short val)
99 WriteValueSlow(ptr, ofs, val, delegate(
IntPtr nativeHome,
int offset,
short value)
115 WriteValueSlow(ptr, ofs, val, delegate(
IntPtr nativeHome,
int offset,
long value)
121 private unsafe
static void WriteValueSlow<T>(
object ptr,
int ofs, T val, Action<IntPtr, int, T> writeValueHelper)
133 writeValueHelper(intPtr, ofs, val);
184 if ((
object)m ==
null)
189 if ((
object)module !=
null)
205 [SupportedOSPlatform(
"windows")]
208 if (typeInfo ==
null)
212 typeInfo.
GetDocumentation(-1, out
string strName, out
string _, out
int _, out
string _);
230 [SupportedOSPlatform(
"windows")]
243 [SupportedOSPlatform(
"windows")]
256 [SupportedOSPlatform(
"windows")]
263 if ((
object)T ==
null)
270 [SupportedOSPlatform(
"windows")]
276 [SupportedOSPlatform(
"windows")]
283 if ((
object)T ==
null)
294 [SupportedOSPlatform(
"windows")]
307 [SupportedOSPlatform(
"windows")]
321 [SupportedOSPlatform(
"windows")]
324 [SupportedOSPlatform(
"windows")]
337 [SupportedOSPlatform(
"windows")]
362 [SupportedOSPlatform(
"windows")]
377 return _ComObject.ReleaseSelf();
383 [SupportedOSPlatform(
"windows")]
398 _ComObject.FinalReleaseSelf();
405 [SupportedOSPlatform(
"windows")]
424 return _ComObject.GetData(
key);
427 [SupportedOSPlatform(
"windows")]
446 return _ComObject.SetData(
key, data);
449 [SupportedOSPlatform(
"windows")]
450 [
return: NotNullIfNotNull(
"o")]
457 if ((
object)t ==
null)
473 if (!o.GetType().IsCOMObject)
477 if (o.GetType() == t)
493 [SupportedOSPlatform(
"windows")]
509 [SupportedOSPlatform(
"windows")]
522 [SupportedOSPlatform(
"windows")]
532 [SupportedOSPlatform(
"windows")]
545 [SupportedOSPlatform(
"windows")]
555 [SupportedOSPlatform(
"windows")]
568 [SupportedOSPlatform(
"windows")]
576 T[]
array =
new T[objectsForNativeVariants.Length];
577 Array.
Copy(objectsForNativeVariants,
array, objectsForNativeVariants.Length);
582 [SupportedOSPlatform(
"windows")]
586 [SupportedOSPlatform(
"windows")]
589 [RequiresUnreferencedCode(
"Built-in COM support is not trim compatible", Url =
"https://aka.ms/dotnet-illink/com")]
590 [SupportedOSPlatform(
"windows")]
604 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2050:UnrecognizedReflectionPattern", Justification =
"The calling method is annotated with RequiresUnreferencedCode")]
608 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2050:UnrecognizedReflectionPattern", Justification =
"The calling method is annotated with RequiresUnreferencedCode")]
612 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2050:UnrecognizedReflectionPattern", Justification =
"The calling method is annotated with RequiresUnreferencedCode")]
616 [SupportedOSPlatform(
"windows")]
636 return new string((sbyte*)(
void*)ptr);
649 return new string((sbyte*)(
void*)ptr, 0,
len);
658 return new string((
char*)(
void*)ptr);
671 return new string((
char*)(
void*)ptr, 0,
len);
680 int byteLength =
string.strlen((
byte*)(
void*)ptr);
681 return string.CreateStringFromEncoding((
byte*)(
void*)ptr, byteLength,
Encoding.
UTF8);
694 return string.CreateStringFromEncoding((
byte*)(
void*)ptr, byteLen,
Encoding.
UTF8);
697 public static int SizeOf(
object structure)
699 if (structure ==
null)
703 return SizeOfHelper(structure.GetType(), throwIfNotMarshalable:
true);
708 if (structure ==
null)
712 return SizeOfHelper(structure.GetType(), throwIfNotMarshalable:
true);
717 if ((
object)t ==
null)
734 Type typeFromHandle = typeof(T);
739 return SizeOfHelper(typeFromHandle, throwIfNotMarshalable:
true);
748 fixed (
Guid* ptr = &iid)
750 fixed (
IntPtr* ptr2 = &ppv)
752 return ((delegate* unmanaged<IntPtr, Guid*, IntPtr*, int>)(*(*(
IntPtr**)(
void*)pUnk)))(pUnk, ptr, ptr2);
763 return ((delegate* unmanaged<IntPtr, int>)(*(
IntPtr*)((nint)(*(
IntPtr*)(
void*)pUnk) +
sizeof(
void*))))(pUnk);
772 return ((delegate* unmanaged<IntPtr, int>)(*(
IntPtr*)((nint)(*(
IntPtr*)(
void*)pUnk) + (nint)2 * (nint)
sizeof(
void*))))(pUnk);
782 return (
IntPtr)((
byte*)ptr + (nuint)((nint)(uint)
index * (nint)arr.GetElementSize()));
792 return (
IntPtr)((
byte*)ptr + (nuint)((nint)(uint)
index * (nint)
Unsafe.SizeOf<T>()));
797 return OffsetOf(typeof(T), fieldName);
918 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
936 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
937 if (((
int)ptr2 & 1) == 0)
939 return *(
short*)ptr2;
941 return Unsafe.ReadUnaligned<
short>(ptr2);
958 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
959 if (((
int)ptr2 & 3) == 0)
963 return Unsafe.ReadUnaligned<
int>(ptr2);
995 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
996 if (((
int)ptr2 & 7) == 0)
1000 return Unsafe.ReadUnaligned<
long>(ptr2);
1017 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
1035 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
1036 if (((
int)ptr2 & 1) == 0)
1038 *(
short*)ptr2 = val;
1042 Unsafe.WriteUnaligned(ptr2, val);
1075 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
1076 if (((
int)ptr2 & 3) == 0)
1082 Unsafe.WriteUnaligned(ptr2, val);
1115 byte* ptr2 = (
byte*)(
void*)ptr + ofs;
1116 if (((
int)ptr2 & 7) == 0)
1122 Unsafe.WriteUnaligned(ptr2, val);
1138 if ((
object)m ==
null)
1145 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2070:UnrecognizedReflectionPattern", Justification =
"This only needs to prelink methods that are actually used")]
1148 if ((
object)c ==
null)
1153 for (
int i = 0; i < methods.Length; i++)
1170 if ((
object)structureType ==
null)
1201 return (T)(object)
null;
1203 Type typeFromHandle = typeof(T);
1254 return s.MarshalToBSTR();
1263 return s.MarshalToString(globalAlloc:
false, unicode:
false);
1272 return s.MarshalToString(globalAlloc:
false, unicode:
true);
1281 return s.MarshalToString(globalAlloc:
true, unicode:
false);
1290 return s.MarshalToString(globalAlloc:
true, unicode:
true);
1300 int num2 = (int)num;
1316 int num = (s.Length + 1) * 2;
1323 *(
short*)((
byte*)(
void*)intPtr + (nint)s.Length * (nint)2) = 0;
1333 int num = (s.Length + 1) * 2;
1340 *(
short*)((
byte*)(
void*)intPtr + (nint)s.Length * (nint)2) = 0;
1352 byte* ptr = (
byte*)(
void*)intPtr;
1369 int num2 = (int)num;
1381 if ((
object)
type ==
null)
1385 if (!
type.IsRuntimeImplemented())
1394 if ((
object)
type ==
null)
1402 if (
type.IsGenericType)
1407 if (customAttribute !=
null)
1409 return customAttribute.Value ??
string.Empty;
1411 return type.FullName;
1420 if ((
object)t ==
null)
1445 Type typeFromHandle = typeof(TDelegate);
1459 if ((
object)d ==
null)
1474 if ((lastPInvokeError & 0x80000000u) == 2147483648u)
1476 return lastPInvokeError;
1478 return (lastPInvokeError & 0xFFFF) | -2147024896;
1499 Buffer.
ZeroMemory((
byte*)(
void*)
s, (nuint)
string.wcslen((
char*)(
void*)
s) * (nuint)2u);
1526 Buffer.
ZeroMemory((
byte*)(
void*)
s, (nuint)
string.wcslen((
char*)(
void*)
s) * (nuint)2u);
1553 return *(uint*)((
byte*)(
void*)
s - 4);
1556 [SupportedOSPlatform(
"windows")]
1604 long num = (long)ptr;
1605 return (num & -65536) == 0;
1608 internal unsafe
static int StringToAnsiString(
string s,
byte*
buffer,
int bufferLength,
bool bestFit =
false,
bool throwOnUnmappableChar =
false)
1610 uint dwFlags = ((!bestFit) ? 1024u : 0u);
1613 fixed (
char* lpWideCharStr =
s)
1628 if (
chars.Length == 0)
1634 fixed (
char* lpWideCharStr =
chars)
1643 return checked(num + 1);
1649 if (
chars.Length == 0)
1655 fixed (
char* lpWideCharStr =
chars)
1657 fixed (
byte* lpMultiByteStr =
bytes)
static unsafe BOOL GetCPInfo(uint codePage, CPINFO *lpCpInfo)
static void SetLastError(int errorCode)
static IntPtr LocalFree(IntPtr hMem)
static unsafe int WideCharToMultiByte(uint CodePage, uint dwFlags, char *lpWideCharStr, int cchWideChar, byte *lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar)
static IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags)
static int GetLastError()
static IntPtr LocalAlloc(uint uFlags, nuint uBytes)
static IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb)
static void CoTaskMemFree(IntPtr ptr)
static IntPtr CoTaskMemAlloc(nuint cb)
static int CLSIDFromProgID(string lpszProgID, out Guid lpclsid)
static IntPtr SysAllocStringLen(IntPtr src, uint len)
static void SysFreeString(IntPtr bstr)
static IntPtr SysAllocStringByteLen(byte[] str, uint len)
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
static ? Attribute GetCustomAttribute(MemberInfo element, Type attributeType)
static unsafe void ZeroMemory(byte *dest, nuint len)
static void KeepAlive(object? obj)
static unsafe int AddRef(IntPtr pUnk)
static ? object[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars)
static void Copy(IntPtr source, double[] destination, int startIndex, int length)
static void GetNativeVariantForObject(object? obj, IntPtr pDstNativeVariant)
static unsafe void ZeroFreeGlobalAllocUnicode(IntPtr s)
static IntPtr GetIUnknownForObjectNative(object o)
static unsafe void WriteByte(IntPtr ptr, int ofs, byte val)
static IntPtr GetFunctionPointerForDelegate< TDelegate >(TDelegate d)
static unsafe int StringToAnsiString(string s, byte *buffer, int bufferLength, bool bestFit=false, bool throwOnUnmappableChar=false)
static T[] GetObjectsForNativeVariants< T >(IntPtr aSrcNativeVariant, int cVars)
static void WriteInt32(object ptr, int ofs, int val)
static TDelegate GetDelegateForFunctionPointer< TDelegate >(IntPtr ptr)
static void DestroyStructure< T >(IntPtr ptr)
static void WriteInt16(IntPtr ptr, char val)
static unsafe void CopyToNative< T >(T[] source, int startIndex, IntPtr destination, int length)
static bool IsNullOrWin32Atom(IntPtr ptr)
static int SizeOf(Type t)
static byte ReadByte(IntPtr ptr)
static Exception GetExceptionForHRInternal(int errorCode, IntPtr errorInfo)
static IntPtr AllocBSTR(int length)
static unsafe string PtrToStringAnsi(IntPtr ptr, int len)
static ? object GetObjectForNativeVariant(IntPtr pSrcNativeVariant)
static void Copy(double[] source, int startIndex, IntPtr destination, int length)
static IntPtr OffsetOf< T >(string fieldName)
static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode)
static void CleanupUnusedObjectsInCurrentContext()
static void WriteInt16(object ptr, int ofs, short val)
static void Copy(char[] source, int startIndex, IntPtr destination, int length)
static long ReadInt64(IntPtr ptr)
static object GetUniqueObjectForIUnknown(IntPtr unknown)
static ? object CreateWrapperOfType(object? o, Type t)
static void WriteInt16(IntPtr ptr, int ofs, char val)
static unsafe string PtrToStringUni(IntPtr ptr, int len)
static void GetNativeVariantForObject< T >(T? obj, IntPtr pDstNativeVariant)
static IntPtr ReAllocHGlobal(IntPtr pv, IntPtr cb)
static object GetObjectForIUnknownNative(IntPtr pUnk)
static void PrelinkCore(MethodInfo m)
static void WriteInt64(IntPtr ptr, long val)
static void CreateBindCtx(uint reserved, out IBindCtx ppbc)
static int GetHRForLastWin32Error()
static void StructureToPtr(object structure, IntPtr ptr, bool fDeleteOld)
static IntPtr GetIDispatchForObject(object o)
static void InternalFinalReleaseComObject(object o)
static void PrelinkAll(Type c)
static ? Type GetTypeFromCLSID(Guid clsid)
static unsafe long ReadInt64(IntPtr ptr, int ofs)
static ? Exception GetExceptionForHR(int errorCode, IntPtr errorInfo)
static IntPtr SecureStringToCoTaskMemAnsi(SecureString s)
static void ThrowExceptionForHR(int errorCode, IntPtr errorInfo)
static int ReleaseComObject(object o)
static void Copy(IntPtr source, IntPtr[] destination, int startIndex, int length)
static void WriteByte(IntPtr ptr, byte val)
static void Copy(float[] source, int startIndex, IntPtr destination, int length)
static void Copy(short[] source, int startIndex, IntPtr destination, int length)
static unsafe void WriteValueSlow< T >(object ptr, int ofs, T val, Action< IntPtr, int, T > writeValueHelper)
static void Copy(IntPtr source, short[] destination, int startIndex, int length)
static ? string PtrToStringAuto(IntPtr ptr, int len)
static IntPtr GetIDispatchForObjectNative(object o)
static unsafe int ReadInt32(IntPtr ptr, int ofs)
static IntPtr GetFunctionPointerForDelegate(Delegate d)
static IntPtr ReadIntPtr(IntPtr ptr, int ofs)
static IntPtr SecureStringToGlobalAllocUnicode(SecureString s)
static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t)
static unsafe T ReadValueSlow< T >(object ptr, int ofs, Func< IntPtr, int, T > readValueHelper)
static void MkParseDisplayName(IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IMoniker ppmk)
static void PtrToStructure< T >(IntPtr ptr, [DisallowNull] T structure)
static IntPtr ReadIntPtr(object ptr, int ofs)
static IntPtr SecureStringToGlobalAllocAnsi(SecureString s)
static int GetLastPInvokeError()
static IntPtr ReadIntPtr(IntPtr ptr)
static unsafe IntPtr StringToCoTaskMemUni(string? s)
static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t)
static IntPtr GetComInterfaceForObject(object o, Type T)
static ? Exception GetExceptionForHR(int errorCode)
static object BindToMoniker(string monikerName)
static void FreeHGlobal(IntPtr hglobal)
static long ReadInt64([In][MarshalAs(UnmanagedType.AsAny)] object ptr, int ofs)
static IntPtr GetHINSTANCE(Module m)
static int ReadInt32(object ptr, int ofs)
static unsafe void WriteInt64(IntPtr ptr, int ofs, long val)
static readonly int SystemDefaultCharSize
static unsafe void ZeroFreeCoTaskMemUTF8(IntPtr s)
static void FreeCoTaskMem(IntPtr ptr)
static unsafe void ZeroFreeBSTR(IntPtr s)
static unsafe int Release(IntPtr pUnk)
static void WriteInt32(IntPtr ptr, int val)
static byte ReadByte(object ptr, int ofs)
static bool IsTypeVisibleFromCom(Type t)
static unsafe short ReadInt16(IntPtr ptr, int ofs)
static Guid GenerateGuidForType(Type type)
static unsafe IntPtr StringToCoTaskMemUTF8(string? s)
static bool AreComObjectsAvailableForCleanup()
static void WriteByte(object ptr, int ofs, byte val)
static object GetObjectForIUnknown(IntPtr pUnk)
static unsafe? string PtrToStringUni(IntPtr ptr)
static void WriteIntPtr(IntPtr ptr, IntPtr val)
static unsafe? string PtrToStringAnsi(IntPtr ptr)
static int GetLastWin32Error()
static int GetExceptionCode()
static object[] GetObjectsForNativeVariantsNative(IntPtr aSrcNativeVariant, int cVars)
static int ReadInt32(IntPtr ptr)
static Delegate GetDelegateForFunctionPointerInternal(IntPtr ptr, Type t)
static unsafe uint SysStringByteLen(IntPtr s)
static int InternalReleaseComObject(object o)
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
static void Copy(IntPtr source, byte[] destination, int startIndex, int length)
static void Copy(IntPtr source, long[] destination, int startIndex, int length)
static IntPtr AllocHGlobal(IntPtr cb)
static void Prelink(MethodInfo m)
static IntPtr CreateAggregatedObjectNative(IntPtr pOuter, object o)
static short ReadInt16(object ptr, int ofs)
static Type GetTypeFromProgID(string progID, string server, bool throwOnError)
static ? string GenerateProgIdForType(Type type)
static IntPtr GetIUnknownForObject(object o)
static void WriteInt16(IntPtr ptr, short val)
static object InternalCreateWrapperOfType(object o, Type t)
static void Copy(IntPtr source, int[] destination, int startIndex, int length)
static void Copy(IntPtr source, char[] destination, int startIndex, int length)
static IntPtr SecureStringToCoTaskMemUnicode(SecureString s)
static void BindMoniker(IMoniker pmk, uint grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult)
static unsafe int GetAnsiStringByteCount(ReadOnlySpan< char > chars)
static bool IsComObject(object o)
static unsafe IntPtr StringToBSTR(string? s)
static IntPtr CreateAggregatedObject(IntPtr pOuter, object o)
static ? object PtrToStructure(IntPtr ptr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type structureType)
static unsafe byte ReadByte(IntPtr ptr, int ofs)
static IntPtr GetComInterfaceForObjectNative(object o, Type t, bool fEnableCustomizedQueryInterface)
static void ZeroFreeCoTaskMemAnsi(IntPtr s)
static bool IsBuiltInComSupported
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
static IntPtr AllocCoTaskMem(int cb)
static TWrapper CreateWrapperOfType< T, TWrapper >(T? o)
static IntPtr StringToCoTaskMemAuto(string? s)
static bool SetComObjectData(object obj, object key, object? data)
static void Copy(long[] source, int startIndex, IntPtr destination, int length)
static unsafe void WriteInt32(IntPtr ptr, int ofs, int val)
static int SizeOf(object structure)
static IntPtr GetHINSTANCE(QCallModule m)
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement< T >(T[] arr, int index)
static unsafe void CopyToManaged< T >(IntPtr source, T[] destination, int startIndex, int length)
static void PtrToStructureHelper(IntPtr ptr, object structure, bool allowValueClasses)
static IntPtr GetFunctionPointerForDelegateInternal(Delegate d)
static object GetUniqueObjectForIUnknownNative(IntPtr unknown)
static unsafe IntPtr StringToCoTaskMemAnsi(string? s)
static void PtrToStructure(IntPtr ptr, object structure)
static short ReadInt16(IntPtr ptr)
static void ThrowExceptionForHR(int errorCode)
static Type GetTypeFromCLSID(Guid clsid, string server, bool throwOnError)
static void SetLastSystemError(int error)
static void GetTypeFromCLSID(in Guid clsid, string server, ObjectHandleOnStack retType)
static bool IsPinnable(object obj)
static unsafe? string PtrToStringUTF8(IntPtr ptr)
static string PtrToStringBSTR(IntPtr ptr)
static void GetNativeVariantForObjectNative(object obj, IntPtr pDstNativeVariant)
static IntPtr OffsetOfHelper(IRuntimeFieldInfo f)
static unsafe void GetAnsiStringBytes(ReadOnlySpan< char > chars, Span< byte > bytes)
static void InternalPrelink(RuntimeMethodHandleInternal m)
static unsafe void ZeroFreeGlobalAllocAnsi(IntPtr s)
static void DestroyStructure(IntPtr ptr, Type structuretype)
static unsafe void ZeroFreeCoTaskMemUnicode(IntPtr s)
static ? string PtrToStringAuto(IntPtr ptr)
static IntPtr GetComInterfaceForObject< T, TInterface >([DisallowNull] T o)
static unsafe IntPtr StringToHGlobalAnsi(string? s)
static object GetObjectForNativeVariantNative(IntPtr pSrcNativeVariant)
static void WriteInt64(object ptr, int ofs, long val)
static void ChangeWrapperHandleStrength(object otp, bool fIsWeak)
static int SizeOfHelper(Type t, bool throwIfNotMarshalable)
static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb)
static readonly int SystemMaxDBCSCharSize
static void WriteInt16([In][Out] object ptr, int ofs, char val)
static void Copy(IntPtr source, float[] destination, int startIndex, int length)
static IntPtr SecureStringToBSTR(SecureString s)
static void SetLastPInvokeError(int error)
static string GetTypeInfoName(ITypeInfo typeInfo)
static unsafe IntPtr StringToHGlobalUni(string? s)
static int GetStartComSlot(Type t)
static int GetHRForException(Exception? e)
static void WriteIntPtr(object ptr, int ofs, IntPtr val)
static void StructureToPtr< T >([DisallowNull] T structure, IntPtr ptr, bool fDeleteOld)
static int GetLastSystemError()
static bool IsBuiltInComSupportedInternal()
static void WriteIntPtr(IntPtr ptr, int ofs, IntPtr val)
static unsafe int GetSystemMaxDBCSCharSize()
static IntPtr AllocBSTRByteLen(uint length)
static IntPtr AllocHGlobal(int cb)
static unsafe string PtrToStringUTF8(IntPtr ptr, int byteLen)
static void InitHandle(SafeHandle safeHandle, IntPtr handle)
static int FinalReleaseComObject(object o)
static unsafe void WriteInt16(IntPtr ptr, int ofs, short val)
static IntPtr StringToHGlobalAuto(string? s)
static void FreeBSTR(IntPtr ptr)
static ? object GetComObjectData(object obj, object key)
static IntPtr CreateAggregatedObject< T >(IntPtr pOuter, T o)
static unsafe int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv)
static ? T GetObjectForNativeVariant< T >(IntPtr pSrcNativeVariant)
static int GetEndComSlot(Type t)
static IntPtr GetExceptionPointers()
static void Copy(IntPtr[] source, int startIndex, IntPtr destination, int length)
static void Copy(byte[] source, int startIndex, IntPtr destination, int length)
static IntPtr OffsetOf(Type t, string fieldName)
static unsafe ref byte GetArrayDataReference(Array array)
void SetHandle(IntPtr handle)
static string NotSupported_COM
static string Argument_OffsetOfFieldNotFound
static string Format(string resourceFormat, object p1)
static string Argument_NeedNonGenericType
static string Argument_TypeMustNotBeComImport
static string Argument_ObjNotComObject
static string ArgumentOutOfRange_StartIndex
static string Arg_MustBeDelegate
static string Argument_MustBeRuntimeMethodInfo
static string Argument_TypeNotComObject
static string Interop_Marshal_Unmappable_Char
static string Argument_MustBeRuntimeFieldInfo
static string ArgumentOutOfRange_NeedNonNegNum
static string Argument_MustBeRuntimeType
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowArgumentNullException(string name)
FieldInfo? GetField(string name)
virtual bool IsGenericType
bool IsRuntimeImplemented()
MethodInfo[] GetMethods()
void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile)
DynamicallyAccessedMemberTypes
static readonly IntPtr Zero
void CopyTo(Span< T > destination)
IntPtr ConvertToNative(object pManagedHome, int dwFlags)
void ClearNative(IntPtr pNativeHome)
unsafe void ConvertToManaged(object pManagedHome, IntPtr pNativeHome)