Partager via


IDebugMemoryContext2::Subtract

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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

Syntax

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

IDebugMemoryContext2