Skip to content

Commit da5b7c5

Browse files
authored
Merge pull request #2534 from changeworld/patch-50
Delete unnecessary spaces
2 parents 3c8a069 + e17b69b commit da5b7c5

File tree

1 file changed

+111
-111
lines changed

1 file changed

+111
-111
lines changed

docs/extensibility/debugger/reference/idebugbinder3-getmemorycontext64.md

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,123 +2,123 @@
22
title: "IDebugBinder3::GetMemoryContext64 | Microsoft Docs"
33
ms.date: "11/04/2016"
44
ms.topic: "conceptual"
5-
helpviewer_keywords:
5+
helpviewer_keywords:
66
- "GetMemoryContext64"
77
- "IDebugBinder3::GetMemoryContext64"
88
ms.assetid: f021fd16-9fc7-4c41-86af-e54e6224cfbb
99
author: "gregvanl"
1010
ms.author: "gregvanl"
1111
manager: jillfra
12-
ms.workload:
12+
ms.workload:
1313
- "vssdk"
1414
---
1515
# IDebugBinder3::GetMemoryContext64
16-
Converts either an object location or a 64-bit memory address to a memory context.
17-
18-
## Syntax
19-
20-
```cpp
21-
HRESULT GetMemoryContext64 (
22-
IDebugField* pField,
23-
UINT64 uConstant,
24-
IDebugMemoryContext2** ppMemCxt
25-
);
26-
```
27-
28-
```csharp
29-
int GetMemoryContext64 (
30-
IDebugField pField,
31-
ulong uConstant,
32-
out IDebugMemoryContext2 ppMemCxt
33-
);
34-
```
35-
36-
#### Parameters
37-
`pField`
38-
[in] An [IDebugField](../../../extensibility/debugger/reference/idebugfield.md) that describes the object to locate. If `NULL`, then use `dwConstant` instead.
39-
40-
`uConstant`
41-
[in] A 64-bit memory address, such as 0x50000000.
42-
43-
`ppMemCxt`
44-
[out] Returns the [IDebugMemoryContext2](../../../extensibility/debugger/reference/idebugmemorycontext2.md) interface that represents the address of the object, or the address in memory.
45-
46-
## Return Value
47-
If successful, returns `S_OK`; otherwise, returns an error code.
48-
49-
## Example
50-
The following examples creates an object that implements the [IDebugBinder3](../../../extensibility/debugger/reference/idebugbinder3.md) interface and uses this method to retrieve the memory context.
51-
52-
```cpp
53-
HRESULT CValueProperty::GetMemoryContext ( IDebugMemoryContext2** out_ppMemoryContext )
54-
{
55-
// precondition
56-
REQUIRE( NULL != out_ppMemoryContext );
57-
58-
if (NULL == out_ppMemoryContext)
59-
return E_POINTER;
60-
61-
*out_ppMemoryContext = NULL;
62-
63-
INVARIANT( this );
64-
65-
if (!this->ClassInvariant())
66-
return E_UNEXPECTED;
67-
68-
if (VT_EMPTY == this->m_VarValue.vt)
69-
{
70-
return E_FAIL;
71-
}
72-
73-
// function body
74-
if (NULL != this->m_pBinder)
75-
{
76-
UINT64 dwOffset = 0;
77-
78-
DEBUG_PROPERTY_INFO dpInfo;
79-
HRESULT HR = this->GetPropertyInfo(DEBUGPROP_INFO_VALUE,
80-
10, // RADIX
81-
DEFAULT_TIMEOUT,
82-
NULL,
83-
0,
84-
&dpInfo);
85-
if (ENSURE( S_OK == HR ))
86-
{
87-
REQUIRE( NULL != dpInfo.bstrValue );
88-
REQUIRE( NULL == dpInfo.bstrName );
89-
REQUIRE( NULL == dpInfo.bstrFullName );
90-
REQUIRE( NULL == dpInfo.bstrType );
91-
REQUIRE( NULL == dpInfo.pProperty );
92-
93-
wchar_t * end;
94-
dwOffset = _wcstoui64(dpInfo.bstrValue, &end, 0); // base 0 to allow 0x if it's ever output
95-
::SysFreeString(dpInfo.bstrValue);
96-
}
97-
98-
if (CComQIPtr<IDebugBinder3> binder3 = this->m_pBinder)
99-
HR = binder3->GetMemoryContext64(NULL, dwOffset, out_ppMemoryContext);
100-
else
101-
HR = this->m_pBinder->GetMemoryContext(NULL, (DWORD)(__int32)dwOffset, out_ppMemoryContext);
102-
103-
if (ENSURE( S_OK == HR ))
104-
{
105-
REQUIRE( NULL != *out_ppMemoryContext );
106-
}
107-
}
108-
109-
// postcondition
110-
INVARIANT( this );
111-
112-
HRESULT HR = E_FAIL;
113-
114-
if (NULL != *out_ppMemoryContext)
115-
{
116-
HR = S_OK;
117-
}
118-
119-
return HR;
120-
}
121-
```
122-
123-
## See Also
124-
[IDebugBinder3](../../../extensibility/debugger/reference/idebugbinder3.md)
16+
Converts either an object location or a 64-bit memory address to a memory context.
17+
18+
## Syntax
19+
20+
```cpp
21+
HRESULT GetMemoryContext64 (
22+
IDebugField* pField,
23+
UINT64 uConstant,
24+
IDebugMemoryContext2** ppMemCxt
25+
);
26+
```
27+
28+
```csharp
29+
int GetMemoryContext64 (
30+
IDebugField pField,
31+
ulong uConstant,
32+
out IDebugMemoryContext2 ppMemCxt
33+
);
34+
```
35+
36+
#### Parameters
37+
`pField`
38+
[in] An [IDebugField](../../../extensibility/debugger/reference/idebugfield.md) that describes the object to locate. If `NULL`, then use `dwConstant` instead.
39+
40+
`uConstant`
41+
[in] A 64-bit memory address, such as 0x50000000.
42+
43+
`ppMemCxt`
44+
[out] Returns the [IDebugMemoryContext2](../../../extensibility/debugger/reference/idebugmemorycontext2.md) interface that represents the address of the object, or the address in memory.
45+
46+
## Return Value
47+
If successful, returns `S_OK`; otherwise, returns an error code.
48+
49+
## Example
50+
The following examples creates an object that implements the [IDebugBinder3](../../../extensibility/debugger/reference/idebugbinder3.md) interface and uses this method to retrieve the memory context.
51+
52+
```cpp
53+
HRESULT CValueProperty::GetMemoryContext ( IDebugMemoryContext2** out_ppMemoryContext )
54+
{
55+
// precondition
56+
REQUIRE( NULL != out_ppMemoryContext );
57+
58+
if (NULL == out_ppMemoryContext)
59+
return E_POINTER;
60+
61+
*out_ppMemoryContext = NULL;
62+
63+
INVARIANT( this );
64+
65+
if (!this->ClassInvariant())
66+
return E_UNEXPECTED;
67+
68+
if (VT_EMPTY == this->m_VarValue.vt)
69+
{
70+
return E_FAIL;
71+
}
72+
73+
// function body
74+
if (NULL != this->m_pBinder)
75+
{
76+
UINT64 dwOffset = 0;
77+
78+
DEBUG_PROPERTY_INFO dpInfo;
79+
HRESULT HR = this->GetPropertyInfo(DEBUGPROP_INFO_VALUE,
80+
10, // RADIX
81+
DEFAULT_TIMEOUT,
82+
NULL,
83+
0,
84+
&dpInfo);
85+
if (ENSURE( S_OK == HR ))
86+
{
87+
REQUIRE( NULL != dpInfo.bstrValue );
88+
REQUIRE( NULL == dpInfo.bstrName );
89+
REQUIRE( NULL == dpInfo.bstrFullName );
90+
REQUIRE( NULL == dpInfo.bstrType );
91+
REQUIRE( NULL == dpInfo.pProperty );
92+
93+
wchar_t * end;
94+
dwOffset = _wcstoui64(dpInfo.bstrValue, &end, 0); // base 0 to allow 0x if it's ever output
95+
::SysFreeString(dpInfo.bstrValue);
96+
}
97+
98+
if (CComQIPtr<IDebugBinder3> binder3 = this->m_pBinder)
99+
HR = binder3->GetMemoryContext64(NULL, dwOffset, out_ppMemoryContext);
100+
else
101+
HR = this->m_pBinder->GetMemoryContext(NULL, (DWORD)(__int32)dwOffset, out_ppMemoryContext);
102+
103+
if (ENSURE( S_OK == HR ))
104+
{
105+
REQUIRE( NULL != *out_ppMemoryContext );
106+
}
107+
}
108+
109+
// postcondition
110+
INVARIANT( this );
111+
112+
HRESULT HR = E_FAIL;
113+
114+
if (NULL != *out_ppMemoryContext)
115+
{
116+
HR = S_OK;
117+
}
118+
119+
return HR;
120+
}
121+
```
122+
123+
## See Also
124+
[IDebugBinder3](../../../extensibility/debugger/reference/idebugbinder3.md)

0 commit comments

Comments
 (0)