IFlexiPTMInfo::GetDescriptionTables (Windows CE 5.0)

Send Feedback

This method gets the description table for processes, threads, and modules.

HRESULT GetDescriptionTables(  [out, size_is(, *pcProcField)] PTM_FIELD_DESC**ppfdProcDescTable,
  [out] DWORD*pcProcField,  [out, size_is(,*pcThreadField)] PTM_FIELD_DESC**ppfdThreadDescTable,
  [out] DWORD*pcThreadField,
  [out, size_is(, *pcModField)] PTM_FIELD_DESC**ppfdModDescTable,
  [out] DWORD*pcModField);

Parameters

  • ppfdProcDescTable
    Pointer to an array of PTM_FIELD_DESC field descriptors for process data.

    The buffer for this value is allocated by CoTaskMemAlloc.

  • pcProcField
    Pointer to the number of fields in ppfdProcDescTable.

  • ppfdThreadDescTable
    Pointer to an array of PTM_FIELD_DESC field descriptors for thread data.

    The buffer for this value is allocated by CoTaskMemAlloc.

  • pcThreadField
    Pointer to the number of fields in ppfdThreadDescTable.

  • ppfdModDescTable
    Pointer to an array of PTM_FIELD_DESC field descriptors for module data.

    The buffer for this value is allocated by CoTaskMemAlloc.

  • pcModField
    Pointer to the number of fields in ppfdModDescTable.

Return Values

The following table shows return values for this method.

Value Description
S_OK Indicates the function was successful.
E_INVALIDARG Indicates one or more invalid arguments.
E_POINTER Indicates one or more invalid pointer values.
E_OUTOFMEMORY Indicates an out of memory error.
E_FAIL Indicates an unspecified failure

Remarks

To avoid resource leaking, use CoTaskMemFree to free the task memory used by the buffers for PTM_FIELD_DESC.szLabel and PTM_FIELD_DESC.szFormat.

The following example shows how you might use CoTaskMemFree to release the memory held for the return buffers.

// Use a utility function
void FreeFlexiDescriptionTable (PTM_FIELD_DESC *pFieldDesc, DWORD cFields)
{
    for (DWORD i = 0; i < cFields; ++i)
    {
        CoTaskMemFree (pFieldDesc[i].szLabel);
        CoTaskMemFree (pFieldDesc[i].szFormat);
    }
    CoTaskMemFree (pFieldDesc);
}

PTM_FIELD_DESC *ppfdProcDescTable, *ppfdThreadDescTable, *ppfdModDescTable;
DWORD pcProcFields, pcThrdFields, pcModFields;

HRESULT hr = piFlexiPTMInfo->GetDescriptionTables (
        &ppfdProcDescTable, &pcProcFields,
        &ppfdThreadDescTable, &pcThrdFields,
        &ppfdModDescTable, &cModFields);
if (SUCCEEDED (hr))
{
    // Use description tables
    FreeFlexiDescriptionTable (ppfdProcDescTable, pcProcFields);
    ppfdProcDescTable = 0;
    FreeFlexiDescriptionTable (ppfdThreadDescTable, pcThrdFields);
    ppfdThreadDescTable = 0;
    FreeFlexiDescriptionTable (ppfdModDescTable, pcModFields);
    ppfdModDescTable = 0;
}

Requirements

OS Version: Windows CE 5.0 and later.
Header: FlexiPMTInfo.h.
Link Library: None.

See Also

IFlexiPTMInfo Interface

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.