Skip to content

Commit c3725d2

Browse files
authored
Merge pull request #206 from cracyc/selectors
fix allocselector when limit is >65536
2 parents 5fe6f31 + fdcd633 commit c3725d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

krnl386/selector.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ WORD WINAPI AllocSelector16( WORD sel )
7777
TRACE("(%04x): returning %04x\n", sel, newsel );
7878
if (!newsel) return 0;
7979
if (!sel) return newsel; /* nothing to copy */
80+
LDT_ENTRY entry, nentry;
81+
wine_ldt_get_entry(sel, &entry);
82+
wine_ldt_set_flags(&nentry, wine_ldt_get_flags(&entry));
8083
for (i = 0; i < count; i++)
8184
{
82-
LDT_ENTRY entry;
83-
wine_ldt_get_entry( sel + (i << __AHSHIFT), &entry );
84-
wine_ldt_set_entry( newsel + (i << __AHSHIFT), &entry );
85+
wine_ldt_set_limit(&nentry, wine_ldt_get_limit(&entry) - (0x10000 * i));
86+
wine_ldt_set_base(&nentry, (DWORD)wine_ldt_get_base(&entry) + (0x10000 * i));
87+
wine_ldt_set_entry(newsel + (i << __AHSHIFT), &nentry);
8588
}
8689
return newsel;
8790
}

0 commit comments

Comments
 (0)