Skip to content

Commit 052d66b

Browse files
authored
Merge pull request #86 from dscho/adjust-fast-cwd-pointer-logic-once-again
Cygwin: Adjust CWD magic to accommodate for the latest Windows previews
2 parents 882031d + b80da35 commit 052d66b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

winsup/cygwin/path.cc

+12
Original file line numberDiff line numberDiff line change
@@ -4794,6 +4794,18 @@ find_fast_cwd_pointer ()
47944794
%rcx for the subsequent RtlEnterCriticalSection call. */
47954795
lock = (const uint8_t *) memmem ((const char *) use_cwd, 80,
47964796
"\x48\x8d\x0d", 3);
4797+
if (lock)
4798+
{
4799+
/* A recent Windows 11 Preview calls `lea rel(rip),%rcx' then
4800+
a `mov` and a `movups` instruction, and only then
4801+
`callq RtlEnterCriticalSection'.
4802+
*/
4803+
if (memmem (lock + 7, 8, "\x4c\x89\x78\x10\x0f\x11\x40\xc8", 8))
4804+
{
4805+
call_rtl_offset = 15;
4806+
}
4807+
}
4808+
47974809
if (!lock)
47984810
{
47994811
/* Windows 8.1 Preview calls `lea rel(rip),%r12' then some unrelated

0 commit comments

Comments
 (0)