Skip to content
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

Remove VtApiRoutines #16954

Merged
merged 5 commits into from
Mar 28, 2024
Merged

Remove VtApiRoutines #16954

merged 5 commits into from
Mar 28, 2024

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Mar 27, 2024

This removes VtApiRoutines and the VT passthrough mode.
Why? While VT passthrough mode has a clear advantage (doesn't corrupt
VT sequences) it fails to address other pain points (performance,
out-of-sync issues after resize, etc.). Alternative options are
available which have less restrictions.
Why now? It's spring! Spring cleanup!

@lhecker lhecker added the Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. label Mar 27, 2024
Comment on lines +176 to +179
catch (const wil::ResultException& e)
{
hr = e.GetStatusCode();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems quite different from what we have today - does it deserve its own PR?

Copy link
Member Author

@lhecker lhecker Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ironically it's what prompted me to make this change before I drifted off. I'd be happy to split this into its own PR. It doesn't change the behavior of this function (there shouldn't have been exceptions so far) nor should there be a performance difference (the catch clauses should be essentially cost free). I'm not sure whether a separate PR is better.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad that this never did quite pan out, but we'll try something else soon I'm sure

@DHowett DHowett enabled auto-merge March 28, 2024 12:21
// This is plenty of space to hold the formatted string
wchar_t cmd[MAX_PATH]{};
const BOOL bInheritCursor = (dwFlags & PSEUDOCONSOLE_INHERIT_CURSOR) == PSEUDOCONSOLE_INHERIT_CURSOR;
const BOOL bResizeQuirk = (dwFlags & PSEUDOCONSOLE_RESIZE_QUIRK) == PSEUDOCONSOLE_RESIZE_QUIRK;
swprintf_s(cmd,
MAX_PATH,
pwszFormat,
L"\"%s\" --headless %s%s--width %hd --height %hd --signal 0x%tx --server 0x%tx",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see you changed additional format parameters here. can you quickly dip into what tx is versus x? we've had it the one way for like five years ;P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x is an unsigned int sized parameter and so it's wrong to pass a void* sized type. The only reason it works is because on x86 the stack word size is 8 bytes and so the alignment of those vararg parameters matches the pointer size. I'm sure it's the same on ARM. Additionally, handle values aren't usually very large.

C99 introduced 3 new prefixes:

  • z: size_t
  • j: intmax_t
  • t: ptrdiff_t

In this case passing t is the right choice. z would also be okay, but only because current architectures have ptrdiff == size.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 28, 2024
@DHowett DHowett added this pull request to the merge queue Mar 28, 2024
Merged via the queue into main with commit 2050416 Mar 28, 2024
22 checks passed
@DHowett DHowett deleted the dev/lhecker/vt-api branch March 28, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants