IFlexiPTMInfo::GetDescriptionTables (Windows Embedded CE 6.0)
1/5/2010
This method gets the description table for processes, threads, and modules.
Syntax
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 Value
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
Header | FlexiPMTInfo.h |
Windows Embedded CE | Windows CE 5.0 and later |