Aracılığıyla paylaş


IDebugThread2::GetThreadProperties

Bu iş parçacığını açıklayan özellikleri alır.

Sözdizimi

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

Parametreler

dwFields
[in] THREADPROPERTY_FIELDS numaralandırmasından hangi alanların ptp doldurulması gerektiğini belirleyen bayrakların birleşimi.

ptp
[in, out] İş parçacığının özellikleriyle doldurulmuş bir THREADPROPERTIES yapısı.

İade Değeri

Başarılı olursa döndürür S_OK; aksi takdirde bir hata kodu döndürür.

Açıklamalar

Bu yöntemden döndürülen bilgiler genellikle İş Parçacıkları hata ayıklama penceresinde gösterilir.

Örnek

Aşağıdaki örnek, IDebugThread2 arabirimini uygulayan basit CProgram bir nesne için bu yöntemin nasıl uygulandığını gösterir.

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;
}

Ayrıca bkz.