GetContext メソッドは、オブジェクトに関連付けられているホスト コンテキストを返します。 これは、ターゲット、プロセス、スレッドなどを表します。オブジェクトの取得元。
構文
HRESULT GetContext(
IDebugHostContext **context
);
パラメーター
context
この引数では、オブジェクトのホスト コンテキストが返されます。
戻り値
このメソッドは、成功または失敗を示す HRESULT を返します。
備考
コード サンプル
ComPtr<IDebugHost> spHost; // get the debug host
ComPtr<IModelObject> spObject; // get an object within a process (or a process object)
ComPtr<IDebugHostContext> spContext;
ComPtr<IDebugHostMemory> spMemory;
if (SUCCEEDED(spObject->GetContext(&spContext)) &&
SUCCEEDED(spHost.As(&spMemory)))
{
// Read 4 bytes from address 0x100 in the process context represented by spObject
char bytes[4];
ULONG64 bytesRead;
HRESULT hr = spMemory->ReadBytes(spContext.Get(), 0x100, bytes, ARRAYSIZE(bytes), &bytesRead);
// Check / Use read.
}
必要条件
要件 | 価値 |
---|---|
ヘッダー | dbgmodel.h |
関連項目
IModelObject インターフェイス の