-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
win,tty: win10 supports utf-16 surrogate pairs #2910
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,12 @@ | |
*/ | ||
|
||
#include <assert.h> | ||
#include <string.h> | ||
|
||
#include "uv.h" | ||
#include "internal.h" | ||
|
||
int is_windows_10_or_greater; | ||
|
||
/* Ntdll function pointers */ | ||
sRtlGetVersion pRtlGetVersion; | ||
|
@@ -51,6 +53,7 @@ void uv_winapi_init(void) { | |
HMODULE powrprof_module; | ||
HMODULE user32_module; | ||
HMODULE kernel32_module; | ||
OSVERSIONINFOW info; | ||
|
||
ntdll_module = GetModuleHandleA("ntdll.dll"); | ||
if (ntdll_module == NULL) { | ||
|
@@ -59,6 +62,12 @@ void uv_winapi_init(void) { | |
|
||
pRtlGetVersion = (sRtlGetVersion) GetProcAddress(ntdll_module, | ||
"RtlGetVersion"); | ||
if (pRtlGetVersion != NULL) { | ||
memset(&info, 0, sizeof(info)); | ||
info.dwOSVersionInfoSize = sizeof(info); | ||
pRtlGetVersion(&info); | ||
is_windows_10_or_greater = (info.dwMajorVersion >= 10); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a fallback setting for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, because in that case |
||
} | ||
|
||
pRtlNtStatusToDosError = (sRtlNtStatusToDosError) GetProcAddress( | ||
ntdll_module, | ||
|
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.
The proposal by Dustin and myself is to also eliminate this restriction entirely.
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.
The question is, does it make sense to pass them through below windows 10? Dustin suggested that it works all the way back to
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.
Yes, that's just the version number for the OS he was running, but it's always been possible to run an arbitrary application on the OS which support this.
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.
bump?