Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/signal_x86_64.c:
+#ifdef __linux__
- if (syscall_flags & SYSCALL_HAVE_WRFSGSBASE)
__asm__ volatile ("rdgsbase %0" : "=r" (cur_gs));
- else
cur_gs = arch_prctl( ARCH_GET_GS, teb );
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- amd64_get_gsbase( &cur_gs );
+#elif defined(__NetBSD__)
- sysarch( X86_64_GET_GSBASE, &cur_gs );
+#elif defined(__APPLE__)
- cur_gs = (ULONG_PTR)mac_thread_gsbase();
+#else +# error Please define getting %gs for your architecture +#endif
- if ((WORD)cur_gs == system_gs) return FALSE;
You're confusing GSBASE (64-bit address registsr) with GS (16-bit segment register).
```suggestion:-0+0 if (cur_gs == (ULONG_PTR)teb) return FALSE; ```