libwine: Set a non-null entry for the GDT selector to make sure it's properly reserved.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-04-21 18:55:17 +02:00
parent e0843d234e
commit 2b1b7a0a80

View file

@ -384,8 +384,10 @@ unsigned short wine_ldt_alloc_fs(void)
global_fs_sel = wine_get_fs();
if (global_fs_sel && is_gdt_sel(global_fs_sel)) return global_fs_sel;
memset( &ldt_info, 0, sizeof(ldt_info) );
ldt_info.entry_number = -1;
fill_modify_ldt_struct( &ldt_info, &null_entry );
ldt_info.seg_32bit = 1;
ldt_info.usable = 1;
if ((ret = set_thread_area( &ldt_info ) < 0))
{
global_fs_sel = 0; /* don't try it again */