terminal/src/propslib
Michael Niksa b2c2a4c159
Prevent crashes in Settings UI launch on OS versions before package management extensions (#10238)
Prevent crashes in Settings UI launch on OS versions before package management extensions

## PR Checklist
* [x] Closes #10106 
* [x] I work here
* [x] Manual tests passed.

## Detailed Description of the Pull Request / Additional comments
- On older OS versions like 18363, some of the COM interfaces we use to look up information from the OS application package management catalog (to find default terminals) are unavailable. This returns `E_NOINTERFACE`. This then ends up returning an empty list of items and null as a selected item. 
- I had intended for that to not return that particular error all the way up and just log it because the console and terminal lookup functions always return at least one element: the one representing the `conhost.exe` that is already on the machine.
- I have changed the "default packages" lookup to log instead of return failures like E_NOINTERFACE such that it can continue processing and make the "package" of the hardcoded `conhost.exe` default no matter what. (It will still return an error if there are somehow 0 packages because that code changed or some other catastrophic event happened...)
- I have also changed the Model to have a nulled DefaultTerminal model object (as all winrt objects are nullable) instead of using an optional. I did this because XAML is perfectly happy receiving a `nullptr` for a selected item and will just not select anything. By contrast, if it has an exception occur... it will just bubble that out and crash.

## Validation Steps Performed
- Simulated no items returned from list and nullptr returned to XAML on Current() method of Model. Validated XAML will happily select no item from list (and is fine with an empty list of items... that is it doesn't crash).
- Simulated downlevel OS returning package management errors in lookup catalog functions after the hardcoded default is added to the list. Ensured that this error is only logged, the remainder of the package identification functions make the hardcoded default package, and it is presented as your one and only option in the XAML.
2021-05-27 17:53:00 +00:00
..
conpropsp.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
DelegationConfig.cpp Prevent crashes in Settings UI launch on OS versions before package management extensions (#10238) 2021-05-27 17:53:00 +00:00
DelegationConfig.hpp Implement UI for choosing default terminal inside Settings page (#9907) 2021-04-28 10:43:30 +00:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
propslib.vcxproj Merged PR 5677497: [Git2Git] Merged PR 5655213: Allow conhost to handoff to registered default app handler 2021-02-11 21:07:50 +00:00
propslib.vcxproj.filters Merged PR 5770253: [Git2Git] Merged PR 5760120: Add propsheet chooser to Windows 2021-03-10 01:19:04 +00:00
RegistrySerialization.cpp Switch to create function as it will open if exists and create if not. 2021-03-29 15:35:16 -05:00
RegistrySerialization.hpp Greatly reduce allocations in the conhost/OpenConsole startup path (#8489) 2020-12-16 10:40:30 -08:00
ShortcutSerialization.cpp Find icon from shortcut target if shortcut doesn't specify it (#6277) 2020-06-01 17:19:05 +00:00
ShortcutSerialization.hpp Find icon from shortcut target if shortcut doesn't specify it (#6277) 2020-06-01 17:19:05 +00:00
sources Merged PR 5677497: [Git2Git] Merged PR 5655213: Allow conhost to handoff to registered default app handler 2021-02-11 21:07:50 +00:00
TrueTypeFontList.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
TrueTypeFontList.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00