terminal/src/interactivity
Michael Niksa 6b2ae625a5
Initialize stack variables. check return code from shell lnk loading (#8712)
## References
* Commit f273aa679d4d9fb516678fc7ed5fc6495a8e8532 from os repository.

## PR Checklist
* [x] Closes #7650 
* [x] I work here.
* [x] Tests passed

## Detailed Description of the Pull Request / Additional comments
* We found and fixed this in November 2017, but I fumbled the replication and accidentally overwrote the commit. This digs it up from history and puts it back in our code.
* When the shortcut file cannot be read for whatever reason, we are setting the hotkey value to uninitialized data as we never initialize several members on the stack in this function. It just so happens that the one in the `dwHotkey` field is commonly `0x4c` or the letter `L` which is then sent into the window procedure to tell the OS to capture it as a global hotkey and foreground the `conhost.exe` that was started. We should realize the load failure and not set any hotkey at all and we should initialize the stack variables. This does both.

## Validation Steps Performed
* [x] Manual scenario running LNK file that cannot be loaded from customer report (make LNK to cmd.exe, make it inaccessible to conhost so it can't load/read it.)
* [x] Manual scenario with `mklink`'d link that makes the shortcut parser attempt to load (and fail because it isn't a LNK at all from #7650)
2021-01-06 12:03:45 +00:00
..
base Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
inc Merged PR 5421982: Reflect OS build changes 2020-11-19 23:21:37 +00:00
onecore Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
win32 Initialize stack variables. check return code from shell lnk loading (#8712) 2021-01-06 12:03:45 +00:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00