-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO NOT MERGE - INBOX INTEGRATION TEST #14005
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
…nIoSrv header This is required for us to build out of the Terminal repo. Related work items: MSFT-40435912
…o use VCPkg Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_we_adept_e4d2 7ea9457533db712ee8e8a5a11e1fbbdfc9430027 Related work items: MSFT:40841395
Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_we_adept_e4d2 4024b6933d446a359a35136053da8b4a8f598d9d Related work items: MSFT-41327033
DHowett
force-pushed
the
dev/duhowett/ibxint
branch
from
September 16, 2022 20:34
e720262
to
6567201
Compare
DHowett
commented
Sep 16, 2022
@@ -20,11 +19,16 @@ constexpr auto WAVE_DATA = std::array<byte, WAVE_SIZE>{ 128, 159, 191, 223, 255, | |||
|
|||
MidiAudio::MidiAudio(HWND windowHandle) | |||
{ | |||
if (SUCCEEDED(DirectSoundCreate8(nullptr, &_directSound, nullptr))) | |||
_directSoundModule.reset(LoadLibraryExW(L"dsound.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j4james Two things!
- Congrats,
DECPS
is now supported in Windows! Rolling out to an insider build near you in a few weeks probably... - It turns out that there are versions of Windows that do not have DirectSound; I hope this is an acceptable solution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! That looks good to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…edirects for MapVKeyW/VkKeyScanW/GetKeyState
This pull request reintroduces aliases for
VkKeyScanW
,MapVirtualKeyW
andGetKeyState
that redirect through ConIoSrv onOneCore 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
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed