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

Cygwin: Adjust CWD magic to accommodate for the latest Windows previews #86

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions winsup/cygwin/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4794,6 +4794,18 @@ find_fast_cwd_pointer ()
%rcx for the subsequent RtlEnterCriticalSection call. */
lock = (const uint8_t *) memmem ((const char *) use_cwd, 80,
"\x48\x8d\x0d", 3);
if (lock)
{
/* A recent Windows 11 Preview calls `lea rel(rip),%rcx' then
a `mov` and a `movups` instruction, and only then
`callq RtlEnterCriticalSection'.
*/
if (memmem (lock + 7, 8, "\x4c\x89\x78\x10\x0f\x11\x40\xc8", 8))
{
call_rtl_offset = 15;
}
}

if (!lock)
{
/* Windows 8.1 Preview calls `lea rel(rip),%r12' then some unrelated
Expand Down