Partager via


IeXdi2EnumCpuRegs::Next (Windows Embedded CE 6.0)

1/5/2010

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

Syntax

HRESULT Next(
  [in] DWORD celt,
  [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.
  • pceltFetched
    Actual number of pointers returned in asCpuRegs.

Return Value

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

Header eXDI2.h
Library ole32.lib, oleaut32.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IeXdi2EnumCpuRegs
IeXDI2 Interfaces