Debugging Tools for Windows

GetValues2

The GetValues2 method fetches the value of several of the target's registers.

HRESULT
  IDebugRegisters2::GetValues2(
    IN ULONG  Source,
    IN ULONG  Count,
    IN PULONG  Indices,
    IN ULONG  Start,
    OUT PDEBUG_VALUE  Values
    );

Parameters

Source
Specifies the register source to query.

The possible values are listed in the following table.

Value Register source
DEBUG_REGSRC_DEBUGGEE Fetch register information from the target.
DEBUG_REGSRC_EXPLICIT Fetch register information from the current explicit register context.
DEBUG_REGSRC_FRAME Fetch register information from the current scope's register context.

Note Stack unwinding does not guarantee accurate updating of the register context, so the scope frame's register context might not be accurate in all cases.

Count
Specifies the number of registers whose values are requested.
Indices
Specifies an array that contains the indices of the registers from which to get the values. The number of elements in this array is Count. If Indices is NULL, Start is used instead.
Start
If Indices is NULL, the registers will be read consecutively starting at this index. Otherwise, it is ignored.
Values
Receives the values of the registers. The number of elements that this array holds is Count. See DEBUG_VALUE for a description of this parameter type.

Return Value

S_OK
The method was successful.
E_INVALIDARG
The value of the index of one of the registers is greater than the number of registers on the target computer. Partial results might have been obtained; those registers that could not be read will have the type DEBUG_VALUE_INVALID.

This list does not contain all the erros that might occur. For a list of possible errors, see HRESULT Values.

Interface Version

GetValues2 is available in IDebugRegisters2 and later versions.

Comments

If the return value is not S_OK, some of the registers still might have been read. If the target was not accessible, the return type is E_UNEXPECTED and Values is unchanged. Otherwise, Values will contain partial results and the registers that could not be read will have type DEBUG_VALUE_INVALID. Ambiguity in the case of the return value E_UNEXPECTED can be avoided by setting the memory of Values to zero before calling this method.

The method GetValues performs the same task as this method but always uses the target as the register source.

For an overview of the IDebugRegisters interface and other register-related methods, see Registers.

Requirements

Headers: Defined in DbgEng.h. Include DbgEng.h.

See Also

GetValue, GetValues

Build machine: CAPEBUILD