Skip to content
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
18 changes: 16 additions & 2 deletions winsup/cygwin/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4581,10 +4581,24 @@ find_fast_cwd_pointer ()
or, then `mov %r12,%rcx', then `callq RtlEnterCriticalSection'. */
lock = (const uint8_t *) memmem ((const char *) use_cwd, 80,
"\x4c\x8d\x25", 3);
if (!lock)
return NULL;
call_rtl_offset = 14;
}

if (!lock)
{
/* A recent Windows Preview calls `lea rel(rip),%r13' then
some unrelated instructions, then `callq RtlEnterCriticalSection'.
*/
lock = (const uint8_t *) memmem ((const char *) use_cwd, 80,
"\x4c\x8d\x2d", 3);
call_rtl_offset = 24;
}

if (!lock)
{
return NULL;
}

PRTL_CRITICAL_SECTION lockaddr =
(PRTL_CRITICAL_SECTION) (lock + 7 + peek32 (lock + 3));
/* Test if lock address is FastPebLock. */
Expand Down