[PR #14005] [MERGED] DO NOT MERGE - INBOX INTEGRATION TEST #29879

Open
opened 2026-01-31 09:37:24 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14005
Author: @DHowett
Created: 9/14/2022
Status: Merged
Merged: 9/16/2022
Merged by: @DHowett

Base: mainHead: dev/duhowett/ibxint


📝 Commits (6)

  • a94e508 Merged PR 7705187: [Git2Git] Merged PR 7693103: Reintroduce OneCore redirects for MapVKeyW/VkKeyScanW/GetKeyState
  • 0973aea Merged PR 7705347: Add stubs to Terminal for OneCoreSafe*, fix the ConIoSrv header
  • 79ef747 Migrate OSS up to 704458ee0
  • d21036d Merged PR 7847415: [Git2Git] Migrate all GSL Golden Path references to use VCPkg
  • fba4e22 Merged PR 7854069: [Git2Git] Build fixes on top of 704458ee0
  • 6567201 Merge remote-tracking branch 'openconsole/inbox' into main

📊 Changes

68 files changed (+628 additions, -101 deletions)

View changed files

📝 dep/Console/ConIoSrv.h (+20 -0)
📝 src/audio/midi/MidiAudio.cpp (+10 -4)
📝 src/audio/midi/MidiAudio.hpp (+1 -0)
src/audio/midi/lib/sources.dep (+3 -0)
src/buffer/out/lib/sources.dep (+3 -0)
src/buffer/out/ut_textbuffer/sources.dep (+3 -0)
📝 src/cascadia/TerminalCore/Terminal.cpp (+20 -0)
src/host/exe/sources.dep (+3 -0)
📝 src/host/ft_host/sources.dep (+3 -0)
📝 src/host/input.cpp (+8 -8)
src/host/lib/sources.dep (+3 -0)
📝 src/host/selectionInput.cpp (+3 -3)
📝 src/host/stream.cpp (+1 -1)
📝 src/host/ut_host/ClipboardTests.cpp (+10 -8)
src/host/ut_host/sources.dep (+3 -0)
src/host/ut_lib/sources.dep (+3 -0)
📝 src/inc/HostAndPropsheetIncludes.h (+8 -0)
📝 src/interactivity/base/EventSynthesis.cpp (+4 -3)
src/interactivity/base/VtApiRedirection.cpp (+75 -0)
📝 src/interactivity/base/lib/InteractivityBase.vcxproj (+2 -0)

...and 48 more files

📄 Description

…edirects for MapVKeyW/VkKeyScanW/GetKeyState

This pull request reintroduces aliases for VkKeyScanW,
MapVirtualKeyW and GetKeyState that redirect through ConIoSrv on
OneCore devices.

We made an assertion in PR !7096375 that those APIs were hosted in an
extension APIset that was present on all OneCore devices. It turned out
that this was incorrect: that APIset extension is only hosted on
OneCoreUAP and above.

This would not be a problem save for NanoServer. NanoServer is built on
top of OneCore.

As Nano is a container host OS, it is primarily interfaced vith via
ConPTY... which exercises the VkKeyScanW/MapVirtualKeyW codepaths quite
a bit. Those APIs started returning invalid data, which caused us to
convert all incoming keyboard events into numpad events. This didn't
prove to be an issue for CMD or PowerShell (weirdly,) but it did prove
to be an issue for Redis. Unfortunately, Redis is exactly the sort of
thing you might want to run in a container.

Reintroducing these aliases was complicated because we took the
opportunity to remove all of IInputServices (!7105348), which was a
wrapper around some code that would choose Win32 or OneCore depending on
the runtime environment.

I made the choice (with the help of Leonard Hecker) to reimplement these
functions in a different way: always call the delay-loaded version, and
then on OneCore editions check the return value and error code to ssee
if we hit a delay load failure. It incurs a minor cost, but all of the
delay loads are in-proc and do not require us to make a syscall, so that
cost is negligible.

Part of this new implementation requires us to change all conhost
internal callers
to use "OneCoreSafe" versions of those APIs. We can't
redirect the user32 versions out of the way and usurp their import
symbols, so this commit also introduces some warning defines. If you use
VkKeyScanW (and friends), you should get a linker error. Assuming
HostAndPropsheetIncludes has been included. It very well may not have
been included.

Fixes MSFT-40435912
Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_wdx_dxp_windev 949e8dfc07f122520c6a74412329a6f7e77d19c5

Summary of the Pull Request

References

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14005 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 9/14/2022 **Status:** ✅ Merged **Merged:** 9/16/2022 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/ibxint` --- ### 📝 Commits (6) - [`a94e508`](https://github.com/microsoft/terminal/commit/a94e508010184a30e0cd24e4d17fca6ed9ef2842) Merged PR 7705187: [Git2Git] Merged PR 7693103: Reintroduce OneCore redirects for MapVKeyW/VkKeyScanW/GetKeyState - [`0973aea`](https://github.com/microsoft/terminal/commit/0973aeab152146b45ac016c21e94d3e079908ad0) Merged PR 7705347: Add stubs to Terminal for OneCoreSafe*, fix the ConIoSrv header - [`79ef747`](https://github.com/microsoft/terminal/commit/79ef7477f2e2fec46fd58e9c7411fc8475d7a1dd) Migrate OSS up to 704458ee0 - [`d21036d`](https://github.com/microsoft/terminal/commit/d21036d313ab5bda7c93451b14245338cd229b72) Merged PR 7847415: [Git2Git] Migrate all GSL Golden Path references to use VCPkg - [`fba4e22`](https://github.com/microsoft/terminal/commit/fba4e227f0c72ea9779682ce432836950179c8f2) Merged PR 7854069: [Git2Git] Build fixes on top of 704458ee0 - [`6567201`](https://github.com/microsoft/terminal/commit/6567201e0e1e72f82bfd3b565a8c3cb95ef2a75d) Merge remote-tracking branch 'openconsole/inbox' into main ### 📊 Changes **68 files changed** (+628 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `dep/Console/ConIoSrv.h` (+20 -0) 📝 `src/audio/midi/MidiAudio.cpp` (+10 -4) 📝 `src/audio/midi/MidiAudio.hpp` (+1 -0) ➕ `src/audio/midi/lib/sources.dep` (+3 -0) ➕ `src/buffer/out/lib/sources.dep` (+3 -0) ➕ `src/buffer/out/ut_textbuffer/sources.dep` (+3 -0) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+20 -0) ➕ `src/host/exe/sources.dep` (+3 -0) 📝 `src/host/ft_host/sources.dep` (+3 -0) 📝 `src/host/input.cpp` (+8 -8) ➕ `src/host/lib/sources.dep` (+3 -0) 📝 `src/host/selectionInput.cpp` (+3 -3) 📝 `src/host/stream.cpp` (+1 -1) 📝 `src/host/ut_host/ClipboardTests.cpp` (+10 -8) ➕ `src/host/ut_host/sources.dep` (+3 -0) ➕ `src/host/ut_lib/sources.dep` (+3 -0) 📝 `src/inc/HostAndPropsheetIncludes.h` (+8 -0) 📝 `src/interactivity/base/EventSynthesis.cpp` (+4 -3) ➕ `src/interactivity/base/VtApiRedirection.cpp` (+75 -0) 📝 `src/interactivity/base/lib/InteractivityBase.vcxproj` (+2 -0) _...and 48 more files_ </details> ### 📄 Description …edirects for MapVKeyW/VkKeyScanW/GetKeyState This pull request reintroduces aliases for `VkKeyScanW`, `MapVirtualKeyW` and `GetKeyState` that redirect through ConIoSrv on OneCore devices. We made an assertion in PR !7096375 that those APIs were hosted in an extension APIset that was present on all OneCore devices. It turned out that this was _incorrect_: that APIset extension is only hosted on OneCoreUAP and above. This would not be a problem save for NanoServer. NanoServer is built on top of OneCore. As Nano is a container host OS, it is primarily interfaced vith via ConPTY... which exercises the VkKeyScanW/MapVirtualKeyW codepaths quite a bit. Those APIs started returning invalid data, which caused us to convert all incoming keyboard events into numpad events. This didn't prove to be an issue for CMD or PowerShell (weirdly,) but it did prove to be an issue for Redis. Unfortunately, Redis is exactly the sort of thing you might want to run in a container. Reintroducing these aliases was complicated because we took the opportunity to remove all of IInputServices (!7105348), which was a wrapper around some code that would choose Win32 or OneCore depending on the runtime environment. I made the choice (with the help of Leonard Hecker) to reimplement these functions in a different way: always call the delay-loaded version, and then on OneCore editions check the return value and error code to ssee if we hit a delay load failure. It incurs a minor cost, but all of the delay loads are in-proc and do not require us to make a syscall, so that cost is negligible. Part of this new implementation requires us to change _all conhost internal callers_ to use "OneCoreSafe" versions of those APIs. We can't redirect the user32 versions out of the way and usurp their import symbols, so this commit also introduces some warning defines. If you use VkKeyScanW (and friends), you _should_ get a linker error. Assuming HostAndPropsheetIncludes has been included. It very well may not have been included. Fixes MSFT-40435912 Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_wdx_dxp_windev 949e8dfc07f122520c6a74412329a6f7e77d19c5<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #xxx * [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:37:24 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29879