Added __wine_set_signal_fs function to avoid sharing the
SYSLEVEL_Win16CurrentTeb variable between kernel and ntdll.
On the kernel side, replaced SYSLEVEL_Win16CurrentTeb by
CallTo16_TebSelector stored directly in the asm relay code to avoid a
run-time relocation.
diff --git a/dlls/kernel/syslevel.c b/dlls/kernel/syslevel.c
index 5653784..790749e 100644
--- a/dlls/kernel/syslevel.c
+++ b/dlls/kernel/syslevel.c
@@ -46,8 +46,10 @@
};
static SYSLEVEL Win16Mutex = { { &critsect_debug, -1, 0, 0, 0, 0 }, 1 };
-/* Global variable to save current TEB while in 16-bit code */
-extern WORD SYSLEVEL_Win16CurrentTeb;
+#ifdef __i386__
+extern unsigned int CallTo16_TebSelector;
+extern void __wine_set_signal_fs( unsigned int fs );
+#endif
/************************************************************************
@@ -114,7 +116,11 @@
lock, lock->level, GetCurrentThreadId(), teb->sys_count[lock->level] );
#ifdef __i386__
- if (lock == &Win16Mutex) SYSLEVEL_Win16CurrentTeb = wine_get_fs();
+ if (lock == &Win16Mutex)
+ {
+ __wine_set_signal_fs( wine_get_fs() );
+ CallTo16_TebSelector = wine_get_fs();
+ }
#endif
}