예제 #1
0
 /// <summary>
 /// Gets information about the layout of an object in memory based
 /// on its type identifier.
 /// </summary>
 /// <param name="id">
 /// A <c>COR_TYPEID</c> token that specifies the type whose layout is desired.
 /// </param>
 /// <param name="pLayout">
 /// A pointer to a <c>COR_TYPE_LAYOUT structur</c>e that contains information
 /// about the layout of the object in memory.
 /// </param>
 /// <remarks>
 /// The <c>ICorDebugProcess5::GetTypeLayout</c> method provides information
 /// about an object based on its <c>COR_TYPEID</c>, which is returned by a
 /// number of other <c>ICorDebugProcess5</c> methods. The information is provided
 /// by a <c>COR_TYPE_LAYOUT</c> structure that is populated by the method.
 /// </remarks>
 public int GetTypeLayout(COR_TYPEID id, out COR_TYPE_LAYOUT pLayout)
 {
     fixed(void *ppLayout = &pLayout)
     {
         return(Calli(_this, This[0]->GetTypeLayout, id.ToCalliArg(), ppLayout));
     }
 }
예제 #2
0
 /// <summary>
 /// Converts an object address to a <c>COR_TYPEID</c> identifier.
 /// </summary>
 /// <param name="obj">
 /// The object address.
 /// </param>
 /// <param name="pId">
 /// A pointer to the <c>COR_TYPEID</c> value that identifies the object.
 /// </param>
 public int GetTypeID(ulong obj, out COR_TYPEID pId)
 {
     fixed(void *ppId = &pId)
     {
         return(Calli(_this, This[0]->GetTypeID, obj, ppId));
     }
 }
예제 #3
0
 /// <summary>
 /// Provides information about the layout of array types.
 /// </summary>
 /// <param name="id">
 /// A <c>COR_TYPEID</c> token that specifies the array whose
 /// layout is desired.
 /// </param>
 /// <param name="pLayout">
 /// A pointer to a <c>COR_ARRAY_LAYOUT</c> structure that contains
 /// information about the layout of the array in memory.
 /// </param>
 public int GetArrayLayout(COR_TYPEID id, out COR_ARRAY_LAYOUT pLayout)
 {
     fixed(void *ptr = &pLayout)
     {
         return(Calli(_this, This[0]->GetArrayLayout, ptr));
     }
 }
예제 #4
0
        /// <summary>
        /// Converts a type identifier to an <c>ICorDebugType</c> value.
        /// </summary>
        /// <param name="id">
        /// The type identifier.
        /// </param>
        /// <param name="ppType">
        /// A pointer to the address of an <c>ICorDebugType</c> object.
        /// </param>
        /// <remarks>
        /// In some cases, methods that return a type identifier may return a
        /// null <c>COR_TYPEID</c> value. If this value is passed as the <c>id</c>
        /// argument, the <c>GetTypeForTypeID</c> method will fail and return <c>E_FAIL</c>.
        /// </remarks>
        public int GetTypeForTypeID(COR_TYPEID id, out CorDebugType ppType)
        {
            void **ptr     = default;
            int    hResult = Calli(_this, This[0]->GetTypeForTypeID, id.ToCalliArg(), &ptr);

            ComFactory.Create(ptr, hResult, out ppType);
            return(hResult);
        }
예제 #5
0
 /// <summary>
 /// Provides information about the fields that belong to a type.
 /// </summary>
 /// <param name="id">
 /// The identifier of the type whose field information is retrieved.
 /// </param>
 /// <param name="fields">
 /// An array of <c>COR_FIELD</c> objects that provide information about
 /// the fields that belong to the type.
 /// </param>
 /// <param name="amountWritten">
 /// A pointer to the number of <c>COR_FIELD</c> objects included in <c>fields</c>.
 /// </param>
 /// <remarks>
 /// The <c>celt</c> parameter, which specifies the number of fields whose
 /// field information the method uses to populate <c>fields</c>, should
 /// correspond to the value of the <c>COR_TYPE_LAYOUT::numFields</c> field.
 /// </remarks>
 public int GetTypeFields(COR_TYPEID id, Span <COR_FIELD> fields, out uint amountWritten)
 {
     fixed(void *pFields = fields)
     fixed(void *pAmountWritten = &amountWritten)
     {
         return(Calli(
                    _this,
                    This[0]->GetTypeFields,
                    Unsafe.As <COR_TYPEID, Primitive128>(ref id),
                    fields.Length,
                    pFields,
                    pAmountWritten));
     }
 }