diff --git a/include/selectors.h b/include/selectors.h index 39a4ba4fc51..dcc0132a7dd 100644 --- a/include/selectors.h +++ b/include/selectors.h @@ -13,9 +13,7 @@ extern WORD SELECTOR_AllocBlock( const void *base, DWORD size, enum seg_type type, BOOL is32bit, BOOL readonly ); -extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size, - enum seg_type type, BOOL is32bit, - BOOL readonly ); +extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size ); extern void SELECTOR_MoveBlock( WORD sel, const void *new_base ); extern void SELECTOR_FreeBlock( WORD sel, WORD count ); diff --git a/memory/global.c b/memory/global.c index f39df52e68b..e5b9a1b32b8 100644 --- a/memory/global.c +++ b/memory/global.c @@ -361,7 +361,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( * change the selector if we are shrinking the block. * FIXME: shouldn't we keep selectors until the block is deleted? */ - SELECTOR_ReallocBlock( sel, 0, 1, SEGMENT_DATA, 0, 0 ); + SELECTOR_ReallocBlock( sel, 0, 1 ); return handle; } @@ -398,7 +398,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( /* Reallocate the selector(s) */ - sel = SELECTOR_ReallocBlock( sel, ptr, size, SEGMENT_DATA, 0, 0 ); + sel = SELECTOR_ReallocBlock( sel, ptr, size ); if (!sel) { HeapFree( SystemHeap, 0, ptr ); diff --git a/memory/selector.c b/memory/selector.c index 250a1ed3369..fd2ba90ebaa 100644 --- a/memory/selector.c +++ b/memory/selector.c @@ -198,14 +198,15 @@ void SELECTOR_FreeBlock( WORD sel, WORD count ) * * Change the size of a block of selectors. */ -WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size, - enum seg_type type, BOOL is32bit, BOOL readonly) +WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size ) { + ldt_entry entry; WORD i, oldcount, newcount; if (!size) size = 1; oldcount = (GET_SEL_LIMIT(sel) >> 16) + 1; newcount = (size + 0xffff) >> 16; + LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry ); if (oldcount < newcount) /* We need to add selectors */ { @@ -231,7 +232,8 @@ WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size, SELECTOR_FreeBlock( ENTRY_TO_SELECTOR(SELECTOR_TO_ENTRY(sel)+newcount), oldcount - newcount ); } - if (sel) SELECTOR_SetEntries( sel, base, size, type, is32bit, readonly ); + if (sel) SELECTOR_SetEntries( sel, base, size, entry.type, + entry.seg_32bit, entry.read_only ); return sel; }