Ignore:
Timestamp:
Aug 27, 2007, 9:54:05 PM (18 years ago)
Author:
bird
Message:

Use the new type system.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/kLdr/kLdrHlpMem.c

    r3537 r3567  
    5252static void            *g_pvStub = NULL;
    5353/** The size of the stub object - 0 if no stub. */
    54 static size_t           g_cbStub = 0;
     54static KSIZE            g_cbStub = 0;
    5555
    5656#elif defined(__WIN__)
     
    107107 * @param   enmProt     The new protection. Copy-on-write is invalid.
    108108 */
    109 int     kldrHlpPageAlloc(void **ppv, size_t cb, KLDRPROT enmProt, unsigned fFixed)
     109int     kldrHlpPageAlloc(void **ppv, KSIZE cb, KLDRPROT enmProt, unsigned fFixed)
    110110{
    111111#ifdef __OS2__
     
    162162 * @param   enmProt     The new protection. Copy-on-write is invalid.
    163163 */
    164 int     kldrHlpPageProtect(void *pv, size_t cb, KLDRPROT enmProt)
     164int     kldrHlpPageProtect(void *pv, KSIZE cb, KLDRPROT enmProt)
    165165{
    166166#ifdef __OS2__
     
    184184            if (rc)
    185185                return rc;
    186             pv = (void *)((uintptr_t)pv + 0x1000);
     186            pv = (void *)((KUPTR)pv + 0x1000);
    187187            cb -= 0x1000;
    188188        }
     
    215215 * @param   cb          The byte count requested from kldrHlpPageAlloc().
    216216 */
    217 int     kldrHlpPageFree(void *pv, size_t cb)
     217int     kldrHlpPageFree(void *pv, KSIZE cb)
    218218{
    219219#ifdef __OS2__
     
    223223     * Deal with any portion overlapping with the stub.
    224224     */
    225     uintptr_t offStub = (uintptr_t)pv - (uintptr_t)g_pvStub;
     225    KUPTR offStub = (KUPTR)pv - (KUPTR)g_pvStub;
    226226    if (offStub < g_cbStub)
    227227    {
    228228        /* decommit the pages in the stub. */
    229         size_t cbStub = KLDR_MIN(g_cbStub - offStub, cb);
     229        KSIZE cbStub = KLDR_MIN(g_cbStub - offStub, cb);
    230230        rc = DosSetMem(pv, cbStub, PAG_DECOMMIT);
    231231        if (rc)
     
    236236                if (!DosSetMem(pv, 0x1000, PAG_DECOMMIT))
    237237                    rc = 0;
    238                 pv = (void *)((uintptr_t)pv + 0x1000);
     238                pv = (void *)((KUPTR)pv + 0x1000);
    239239                cbStub -= 0x1000;
    240240                cb -= 0x1000;
     
    251251            if (!cb)
    252252                return 0;
    253             pv = (void *)((uintptr_t)pv + cbStub);
     253            pv = (void *)((KUPTR)pv + cbStub);
    254254        }
    255255    }
Note: See TracChangeset for help on using the changeset viewer.