IFlexiPTMInfo::GetData (Windows CE 5.0)
This method gets the data associated with specified processes, threads, or modules.
HRESULT GetData( [in] FLEXI_GETDATA_TYPEfgds, [out, size_is(, *pcProcess)] PTM_RAW_DATA **ppdatProcess, [out] DWORD * pcProcess, [out] DWORD * pcProcessTotal, [out, size_is(, *pcThread)] PTM_RAW_DATA **ppdatThread, [out] DWORD * pcThread, [out] DWORD * pcThreadTotal, [out, size_is(, *pcModule)] PTM_RAW_DATA **ppdatModule, [out] DWORD *pcModule, [out] DWORD *pcModuleTotal);
Parameters
fgds
Specification of which processes, thread, or module to retrieve.pdatProcess
Pointer to an array of PTM_RAW_DATA structures that contain process data.The buffer for this value is allocated by CoTaskMemAlloc.
pcProcess
Number of processes returned.pcProcessTotal
Total number of processes.pdatThread
Pointer to an array of PTM_RAW_DATA structures that contain thread data.The buffer for this value is allocated by CoTaskMemAlloc.
pcThread
Number of threads returned.pcThreadTotal
Total number of threads.pdatModule
Pointer to an array of PTM_RAW_DATA structures that contain module data.The buffer for this value is allocated by CoTaskMemAlloc.
pcModule
Number of modules returned.pcModuleTotal
Total number of modules.
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
The method returns data in the PTM_RAW_DATA structure, along with a count of processes, threads, or modules in the pcProcessTotal, pcThreadTotal, and pcModuleTotal parameters.
Each PTM_RAW_DATA consists of an array of bytes that juxtapose all fields.
To avoid resource leaking, use CoTaskMemFree to free the task memory used by the buffers PTM_RAW_DATA.pbRawData*.*
The following example shows how you might use CoTaskMemFree to release the memory held for the return buffers.
.// Use a utility function
void FreePTMRawData (DWORD cData, PTM_RAW_DATA *pData)
{
for (DWORD i = 0; i < cData; ++i)
{
CoTaskMemFree (pData[i].pbRawData);
}
CoTaskMemFree (pData);
}
PTM_RAW_DATA *ppdatProcess, *ppdatThread, *ppdatModule;
DWORD pcProcess, pcThread, pcModule;
DWORD pcProcessTotal, pcThreadTotal, pcModuleTotal;
HRESULT hr = piFlexiPTMInfo->GetData (fgds,
&ppdatProcess, &pcProcess, &pcProcessTotal,
&ppdatThread, &pcThread, &cThreadTotal,
&ppdatModule, &pcModule, &pcModuleTotal);
if (SUCCEEDED (hr))
{
// Use data...
FreePTMRawData (ppdatProcess, pcProcess);
ppdatProcess = 0;
FreePTMRawData (ppdatThread, pcThread);
ppdatThread = 0;
FreePTMRawData (ppdatModule, pcModule);
ppdatModule = 0;
}
Requirements
OS Version: Windows CE 5.0 and later.
Header: FlexiPMTInfo.h.
Link Library: None.
See Also
Send Feedback on this topic to the authors