krnl386.exe16: Use FIELD_OFFSET for the size of structs with varlength arrays.
This commit is contained in:
parent
0b02d25f6d
commit
a5c621d40e
@ -163,7 +163,7 @@ WORD WINAPI InitAtomTable16( WORD entries )
|
|||||||
/* Allocate the table */
|
/* Allocate the table */
|
||||||
|
|
||||||
if (!entries) entries = DEFAULT_ATOMTABLE_SIZE; /* sanity check */
|
if (!entries) entries = DEFAULT_ATOMTABLE_SIZE; /* sanity check */
|
||||||
handle = LocalAlloc16( LMEM_FIXED, sizeof(ATOMTABLE) + (entries-1) * sizeof(HANDLE16) );
|
handle = LocalAlloc16( LMEM_FIXED, FIELD_OFFSET( ATOMTABLE, entries[entries] ));
|
||||||
if (!handle) return 0;
|
if (!handle) return 0;
|
||||||
table = MapSL( MAKESEGPTR( CURRENT_DS, handle ) );
|
table = MapSL( MAKESEGPTR( CURRENT_DS, handle ) );
|
||||||
table->size = entries;
|
table->size = entries;
|
||||||
|
@ -200,7 +200,7 @@ static SEGPTR TASK_AllocThunk(void)
|
|||||||
sel = pThunk->next;
|
sel = pThunk->next;
|
||||||
if (!sel) /* Allocate a new segment */
|
if (!sel) /* Allocate a new segment */
|
||||||
{
|
{
|
||||||
sel = GLOBAL_Alloc( GMEM_FIXED, sizeof(THUNKS) + (MIN_THUNKS-1)*8,
|
sel = GLOBAL_Alloc( GMEM_FIXED, FIELD_OFFSET( THUNKS, thunks[MIN_THUNKS] ),
|
||||||
pTask->hPDB, WINE_LDT_FLAGS_CODE );
|
pTask->hPDB, WINE_LDT_FLAGS_CODE );
|
||||||
if (!sel) return 0;
|
if (!sel) return 0;
|
||||||
TASK_CreateThunks( sel, 0, MIN_THUNKS );
|
TASK_CreateThunks( sel, 0, MIN_THUNKS );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user