Skip to content

Commit 73383b0

Browse files
Taojunshenopbld17colin-homeopbld16opbld15
authored
10/12/2022 AM Publish (#4574)
* Document ARM64 unwind handling for return address signing * Update date, fix step numbers * Fix style, grammar in Arm64 Exception * Rename pac_sign_lr and update reserved ranges. * example needed to mitigate dev floundering (#4210) It is not easy to match up variant vt types with POD types. Especially since there is a gradual transition to modern C++. I used a number of dev hours on attempts to match the variant type, vt, to make the true/false work. The m_bValue type for the simple property was a BOOL type, but trying to create a variant of type BOOL directly didn't work. Only by looking at VC Sample code for VisualStudioDemo did I see the (_variant_t)true construct, which becomes the standard_cast contruct in modern C++. I figured my Example code could make other programmer's efforts easier. * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4571) * 10/11/2022 AM Publish (#4570) * Document ARM64 unwind handling for return address signing * Update date, fix step numbers * Fix style, grammar in Arm64 Exception Co-authored-by: opbld17 <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: prmerger-automator[bot] <40007230+prmerger-automator[bot]@users.noreply.github.com> * example needed to mitigate dev floundering (#4210) It is not easy to match up variant vt types with POD types. Especially since there is a gradual transition to modern C++. I used a number of dev hours on attempts to match the variant type, vt, to make the true/false work. The m_bValue type for the simple property was a BOOL type, but trying to create a variant of type BOOL directly didn't work. Only by looking at VC Sample code for VisualStudioDemo did I see the (_variant_t)true construct, which becomes the standard_cast contruct in modern C++. I figured my Example code could make other programmer's efforts easier. Co-authored-by: Taojunshen <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: prmerger-automator[bot] <40007230+prmerger-automator[bot]@users.noreply.github.com> Co-authored-by: rtischer8277 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: prmerger-automator[bot] <40007230+prmerger-automator[bot]@users.noreply.github.com> Co-authored-by: Pedro Miguel Justo <[email protected]> Co-authored-by: rtischer8277 <[email protected]> Co-authored-by: Feng Xu <[email protected]>
1 parent cfc4218 commit 73383b0

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

docs/build/arm64-exception-handling.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,20 @@ The unwind codes are encoded according to the table below. All unwind codes are
311311
| | 11101000: Custom stack for `MSFT_OP_TRAP_FRAME` |
312312
| | 11101001: Custom stack for `MSFT_OP_MACHINE_FRAME` |
313313
| | 11101010: Custom stack for `MSFT_OP_CONTEXT` |
314+
| | 11101011: Custom stack for `MSFT_OP_EC_CONTEXT` |
314315
| | 11101100: Custom stack for `MSFT_OP_CLEAR_UNWOUND_TO_CALL` |
315-
| | 1111xxxx: reserved |
316-
| `pac_sign_return_address` | 11111100: sign the return address in `lr` with `pacibsp` |
316+
| | 11101101: reserved |
317+
| | 11101110: reserved |
318+
| | 11101111: reserved |
319+
| | 11110xxx: reserved |
320+
| | 11111000'yyyyyyyy : reserved |
321+
| | 11111001'yyyyyyyy'yyyyyyyy : reserved |
322+
| | 11111010'yyyyyyyy'yyyyyyyy'yyyyyyyy : reserved |
323+
| | 11111011'yyyyyyyy'yyyyyyyy'yyyyyyyy'yyyyyyyy : reserved |
324+
| `pac_sign_lr` | 11111100: sign the return address in `lr` with `pacibsp` |
325+
| | 11111101: reserved |
326+
| | 11111110: reserved |
327+
| | 11111111: reserved |
317328

318329
In instructions with large values covering multiple bytes, the most significant bits are stored first. This design makes it possible to find the total size in bytes of the unwind code by looking up only the first byte of the code. Since each unwind code is exactly mapped to an instruction in a prolog or epilog, you can compute the size of the prolog or epilog. Walk from the sequence start to the end, and use a lookup table or similar device to determine the length of the corresponding opcode.
319330

docs/mfc/reference/cmfcpropertygridproperty-class.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,17 @@ Sets the value of a property grid property.
15131513
```
15141514
virtual void SetValue(const _variant_t& varValue);
15151515
```
1516-
1516+
Example:
1517+
```
1518+
void SetPropBarValue( UINT propId, const DWORD& barPropDwordValue )
1519+
{
1520+
auto property = propertiesGridCtrlList.FindItemByData( propId );
1521+
if( property )
1522+
{
1523+
property->SetValue( static_cast< _variant_t >( barPropDwordValue == 1 ) ); // sets property bar value to true or false depending on dword value
1524+
}
1525+
}
1526+
```
15171527
### Parameters
15181528
15191529
*`varValue`*\

0 commit comments

Comments
 (0)