Use the "new" LDT set call on Linux.

This commit is contained in:
Alexandre Julliard 2002-08-14 21:10:50 +00:00
parent 124eaf809c
commit 4ced7ef45f
2 changed files with 6 additions and 5 deletions

View file

@ -48,6 +48,7 @@ struct modify_ldt_s
unsigned int read_exec_only : 1;
unsigned int limit_in_pages : 1;
unsigned int seg_not_present : 1;
unsigned int useable:1;
};
static inline int modify_ldt( int func, struct modify_ldt_s *ptr,
@ -140,8 +141,9 @@ int wine_ldt_set_entry( unsigned short sel, const LDT_ENTRY *entry )
ldt_info.read_exec_only = !(entry->HighWord.Bits.Type & 2);
ldt_info.limit_in_pages = entry->HighWord.Bits.Granularity;
ldt_info.seg_not_present = !entry->HighWord.Bits.Pres;
ldt_info.useable = entry->HighWord.Bits.Sys;
if ((ret = modify_ldt(1, &ldt_info, sizeof(ldt_info))) < 0)
if ((ret = modify_ldt(0x11, &ldt_info, sizeof(ldt_info))) < 0)
perror( "modify_ldt" );
}
#endif /* linux */

View file

@ -119,12 +119,12 @@ WORD WINAPI FreeSelector16( WORD sel )
#ifdef __i386__
/* Check if we are freeing current %fs or %gs selector */
if (!((wine_get_fs() ^ sel) & ~7))
if (!((wine_get_fs() ^ sel) & ~3))
{
WARN("Freeing %%fs selector (%04x), not good.\n", wine_get_fs() );
wine_set_fs( 0 );
}
if (!((wine_get_gs() ^ sel) & ~7)) wine_set_gs( 0 );
if (!((wine_get_gs() ^ sel) & ~3)) wine_set_gs( 0 );
#endif /* __i386__ */
wine_ldt_set_entry( sel, &null_entry );
@ -161,8 +161,7 @@ static void SELECTOR_SetEntries( WORD sel, const void *base, DWORD size, unsigne
WORD i, count;
wine_ldt_set_base( &entry, base );
/* Make sure base and limit are not 0 together if the size is not 0 */
wine_ldt_set_limit( &entry, (!base && size == 1) ? 1 : size - 1 );
wine_ldt_set_limit( &entry, size - 1 );
wine_ldt_set_flags( &entry, flags );
count = (size + 0xffff) / 0x10000;
for (i = 0; i < count; i++)