共用方式為


IDebugMemoryContext2::Subtract

Subtracts the specified value from the current context and returns a new context.

HRESULT Subtract( 
   UINT64                 dwCount,
   IDebugMemoryContext2** ppMemCxt
);
int Subtract(
   ulong                    dwCount, 
   out IDebugMemoryContext2 ppMemCxt
);

Parameters

  • dwCount
    [in] The number of memory bytes to decrement.

  • ppMemCxt
    [out] Returns a new IDebugMemoryContext2 object.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

A memory context is an address, so subtracting a value from an address produces a new address that requires a new context interface.

This method must always produce a new context, even if the resulting address is outside the memory space associated with this context. The only exception to this is if no memory can be allocated for the new context or if ppMemCxt is a null value (which is an error).

See Also

Reference

IDebugMemoryContext2