static DmdConstructorInfo Initialize(DmdAppDomain appDomain, DmdMarshalType marshalType) { if (marshalType == null) { return(null); } var caType = appDomain.GetWellKnownType(DmdWellKnownType.System_Runtime_InteropServices_MarshalAsAttribute, isOptional: true); var unmanagedTypeType = appDomain.GetWellKnownType(DmdWellKnownType.System_Runtime_InteropServices_UnmanagedType, isOptional: true); var varEnumType = appDomain.GetWellKnownType(DmdWellKnownType.System_Runtime_InteropServices_VarEnum, isOptional: true); if ((object)caType == null || (object)unmanagedTypeType == null || (object)varEnumType == null) { return(null); } var ctor = caType.GetConstructor(new[] { unmanagedTypeType }); Debug.Assert((object)ctor != null); return(ctor); }
/// <summary> /// Gets the debugger AppDomain object /// </summary> /// <param name="appDomain">Debugger metadata AppDomain object</param> /// <returns></returns> public static DbgAppDomain GetDebuggerAppDomain(this DmdAppDomain appDomain) => appDomain.GetData <DbgAppDomain>();