Partilhar via


IDebugThread2::GetThreadProperties

Obtém as propriedades que descrevem este segmento.

HRESULT GetThreadProperties ( 
   THREADPROPERTY_FIELDS dwFields,
   THREADPROPERTIES*     ptp
);
int GetThreadProperties ( 
   enum_THREADPROPERTY_FIELDS dwFields,
   THREADPROPERTIES[]         ptp
);

Parâmetros

  • dwFields
    [in] Uma combinação de sinalizadores da THREADPROPERTY_FIELDS enumeração que determina quais campos de ptp está a ser preenchido.

  • ptp
    [in, out] A THREADPROPERTIES estrutura que é preenchido com as propriedades do segmento.

Valor de retorno

Se bem-sucedida, retorna S_OK; Caso contrário, retorna um código de erro.

Comentários

Normalmente, as informações retornadas deste método são mostradas na segmentos janela de depuração.

Exemplo

O exemplo a seguir mostra como implementar este método para um simples CProgram objeto que implementa o IDebugThread2 interface.

HRESULT CProgram::GetThreadProperties(THREADPROPERTY_FIELDS dwFields,
                                      THREADPROPERTIES *ptp)
{
    HRESULT hr = E_FAIL;  
  
    // Check for valid argument.  
   if (ptp)  
    {  
      // Create an array of buffers at ptp the size of the
      // THREADPROPERTIES structure and set all of the
      // buffers at ptp to 0.  
      memset(ptp, 0, sizeof (THREADPROPERTIES));  
  
      // Check if there is a valid THREADPROPERTY_FIELDS and the TPF_ID flag is set.  
      if (dwFields & TPF_ID)  
      {  
         // Check for successful assignment of the current thread ID to
         //  the dwThreadId of the passed THREADPROPERTIES.  
         if (GetThreadId(&(ptp->dwThreadId)) == S_OK)  
         {  
            // Set the TPF_ID flag in the THREADPROPERTY_FIELDS enumerator  
            // of the passed THREADPROPERTIES.  
            ptp->dwFields |= TPF_ID;  
         }  
      }  
  
      hr = S_OK;  
    }  
    else  
        hr = E_INVALIDARG;  
  
    return hr;  
}  

Consulte também

Referência

IDebugThread2

THREADPROPERTY_FIELDS

THREADPROPERTIES