Changeset 54 for trunk/kLdr/kLdrMod.c


Ignore:
Timestamp:
Oct 9, 2013, 9:52:48 PM (12 years ago)
Author:
bird
Message:

Added kLdrModQueryImageUuid for Mach-O.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdrMod.c

    r52 r54  
    511511 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits().
    512512 *                          This can be used by some module interpreters to reduce memory consumption.
     513 * @param   enmArch         The CPU architecture.
     514 * @param   enmCpu          The CPU series/model.
    513515 */
    514516int     kLdrModCanExecuteOn(PKLDRMOD pMod, const void *pvBits, KCPUARCH enmArch, KCPU enmCpu)
     
    560562    *pMainEPAddress = 0;
    561563    return pMod->pOps->pfnQueryMainEntrypoint(pMod, pvBits, BaseAddress, pMainEPAddress);
     564}
     565
     566
     567/**
     568 * Queries the image UUID, if the image has one.
     569 *
     570 * @returns 0 and *pvUuid. Non-zero status code on failure.
     571 * @param   pMod            The module.
     572 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits() currently located at BaseAddress.
     573 *                          This can be used by some module interpreters to reduce memory consumption.
     574 * @param   pvUuid          Where to store the UUID.
     575 * @param   cbUuid          Size of the UUID buffer, must be at least 16 bytes.
     576 */
     577int     kLdrModQueryImageUuid(PKLDRMOD pMod, const void *pvBits, void *pvUuid, KSIZE cbUuid)
     578{
     579    KLDRMOD_VALIDATE(pMod);
     580    if (cbUuid < 16)
     581        return KERR_INVALID_SIZE;
     582    if (pMod->pOps->pfnQueryImageUuid)
     583        return pMod->pOps->pfnQueryImageUuid(pMod, pvBits, pvUuid, cbUuid);
     584    return KLDR_ERR_NO_IMAGE_UUID;
    562585}
    563586
Note: See TracChangeset for help on using the changeset viewer.