Пример #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 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);
        }