Ignore:
Timestamp:
Nov 29, 1999, 10:28:00 PM (26 years ago)
Author:
bird
Message:

Patch from Vit Timchishin applied to both addEntry and addForwarderEntry.
Patches: An entry bundle can't skip more than 255 entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/pe2lx/pe2lx.cpp

    r1875 r1880  
    1 /* $Id: pe2lx.cpp,v 1.12 1999-11-29 00:33:38 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.13 1999-11-29 21:28:00 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    33153315 *            Find object and offObject corresponding to the entrypoint RVA.
    33163316 *            IF no enough memory THEN (try) allocate more.
    3317  *            IF last ordinal + 1 != new ordinal THEN
     3317 *            LOOP WHILE last ordinal + 1 != new ordinal
    33183318 *            BEGIN
    33193319 *                Add unused entry which skips to the new ordinal - 1.
    33203320 *                Update offCurEntryBundle
    33213321 *                Set offLastEntryBundle to offLastEntryBundle.
     3322 *                IF no enough memory THEN (try) allocate more.
    33223323 *            END
    33233324 *            IF offCurEntryBundle == offLastEntryBundle OR last bundle type != 32-bit entry
     
    34393440
    34403441    /* Add unused entry to skip ordinals? */
    3441     if (ulOrdinal > ulLastOrdinal + 1)
     3442    while (ulOrdinal > ulLastOrdinal + 1)
    34423443    {
    34433444        /* Add unused entry which skips to the new ordinal - 1.*/
    34443445        pBundle = (struct b32_bundle *)((ULONG)pEntryBundles + offCurEntryBundle);
    3445         pBundle->b32_cnt = (UCHAR)(ulOrdinal - ulLastOrdinal - 1);
     3446        pBundle->b32_cnt = (ulOrdinal - ulLastOrdinal - 1) < 0x100 ?
     3447            (UCHAR)(ulOrdinal - ulLastOrdinal - 1) : (UCHAR)0xff;
    34463448        pBundle->b32_type = EMPTY;
     3449        ulLastOrdinal += pBundle->b32_cnt;
    34473450
    34483451        /* Update offCurEntryBundle and offLastEntryBundle */
    34493452        offLastEntryBundle = offCurEntryBundle += 2UL;
     3453
     3454        /* IF no enough memory THEN (try) allocate more. */
     3455        AllocateMoreMemory(offCurEntryBundle + 4 + 2 + 5  > cbEBAllocated /* max memory uasage! Should detect more exact memory usage! */,
     3456                           pEntryBundles, struct b32_bundle *, cbEBAllocated , 512, 256)
    34503457    }
    34513458
     
    36363643
    36373644    /* Add unused entry to skip ordinals? */
    3638     if (ulOrdinal > ulLastOrdinal + 1)
     3645    while (ulOrdinal > ulLastOrdinal + 1)
    36393646    {
    36403647        /* Add unused entry which skips to the new ordinal - 1.*/
    36413648        pBundle = (struct b32_bundle *)((ULONG)pEntryBundles + offCurEntryBundle);
    3642         pBundle->b32_cnt = (UCHAR)(ulOrdinal - ulLastOrdinal - 1);
     3649        pBundle->b32_cnt = (ulOrdinal - ulLastOrdinal - 1) < 0x100 ?
     3650            (UCHAR)(ulOrdinal - ulLastOrdinal - 1) : (UCHAR)0xff;
    36433651        pBundle->b32_type = EMPTY;
     3652        ulLastOrdinal += pBundle->b32_cnt;
    36443653
    36453654        /* Update offCurEntryBundle and offLastEntryBundle */
    36463655        offLastEntryBundle = offCurEntryBundle += 2UL;
     3656
     3657        /* IF no enough memory THEN (try) allocate more. */
     3658        AllocateMoreMemory(offCurEntryBundle + 4 + 2 + 7  > cbEBAllocated /* max memory uasage! Should detect more exact memory usage! */,
     3659                           pEntryBundles, struct b32_bundle *, cbEBAllocated , 512, 256)
    36473660    }
    36483661
Note: See TracChangeset for help on using the changeset viewer.