Partager via


IeXdi2EnumCpuRegs::Next (Windows CE 5.0)

Send Feedback

This method gets an array of a given number of pointers to the next CPU register object in the enumerated list.

HRESULT Next(  [in] DWORDcelt,
  [out, size_is(celt), length_is(*pceltFetched)] CPU_REG_STRUCT asCpuRegs[],  [out] DWORD* pceltFetched);

Parameters

  • celt
    Requested number of CPU register object pointers to be returned.

  • asCpuRegs
    Array of CPU_REG_STRUCT register information structures.

    The buffer for this value is allocated by CoTaskMemAlloc.

  • pceltFetched
    Actual number of pointers returned in asCpuRegs.

Return Values

The following table shows the return values for this method.

Value Description
S_OK Indicates the function was successful.
E_FAIL Indicates an unspecified failure.
EXDI_E_COMMUNICATION Indicates a communication error between host driver and debugging target.

Remarks

To avoid resource leaking, use CoTaskMemFree to free the task memory used by the buffer for the CPU_REG_STRUCT array, asCpuRegs, that this function returns*.*

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

CPU_REG_ARRAY_LENGTH, asCpuRegs
// 
const DWORD CPU_REG_ARRAY_LENGTH = 10;
CPU_REG_STRUCT asCpuRegs[CPU_REG_ARRAY_LENGTH];
DWORD pceltFetched;
HRESULT hr = pieXdi2EnumCpuRegs->Next (CPU_REG_ARRAY_LENGTH, asCpuRegs, &pceltFetched);
if (SUCCEEDED (hr))
{
    // Use register info ...
    for (DWORD i = 0; i < pceltFetched; ++i)
    {
        CoTaskMemFree (aCpuRegs[i].szRegName);
        aCpuRegs[i].szRegName = 0;
    }
}

Requirements

OS Version: Windows CE 5.0 and later.
Header: eXDI2.h.
Link Library: ole32.lib, oleaut32.lib.

See Also

IeXDI2 Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.