Commit c942f9cc authored by Pierre Beyssac's avatar Pierre Beyssac Committed by Alexandre Julliard

Force DPL 3 when setting entries on BSD.

parent 0ab07048
......@@ -133,7 +133,12 @@ int wine_ldt_set_entry( unsigned short sel, const LDT_ENTRY *entry )
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
{
ret = i386_set_ldt(index, (union descriptor *)entry, 1);
LDT_ENTRY entry_copy = *entry;
/* The kernel will only let us set LDTs with user priority level */
if (entry_copy.HighWord.Bits.Pres
&& entry_copy.HighWord.Bits.Dpl != 3)
entry_copy.HighWord.Bits.Dpl = 3;
ret = i386_set_ldt(index, (union descriptor *)&entry_copy, 1);
if (ret < 0)
{
perror("i386_set_ldt");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment