VirtualBox

Ignore:
Timestamp:
Aug 18, 2014 8:35:32 PM (10 years ago)
Author:
vboxsync
Message:

SUP,IPRT: Extended RTLdrQueryPropEx with a pvBits parameter, RTLDRPROP_IMPORT_COUNT and RTLDRPROP_IMPORT_MODULE. Hook LdrLoadDll to validate DLLs before they get to NtCreateSection and the loader code/data can be messed up (windows 7 / 32-bit crash). Allow the kernel to buffer the log file, no real need that each write hits the disk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp

    r52213 r52403  
    590590RTDECL(int) RTLdrQueryProp(RTLDRMOD hLdrMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf)
    591591{
    592     return RTLdrQueryPropEx(hLdrMod, enmProp, pvBuf, cbBuf, NULL);
     592    return RTLdrQueryPropEx(hLdrMod, enmProp, NULL /*pvBits*/, pvBuf, cbBuf, NULL);
    593593}
    594594RT_EXPORT_SYMBOL(RTLdrQueryProp);
    595595
    596596
    597 RTDECL(int) RTLdrQueryPropEx(RTLDRMOD hLdrMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet)
     597RTDECL(int) RTLdrQueryPropEx(RTLDRMOD hLdrMod, RTLDRPROP enmProp, void *pvBits, void *pvBuf, size_t cbBuf, size_t *pcbRet)
    598598{
    599599    AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), RTLDRENDIAN_INVALID);
     
    629629            AssertReturn(cbBuf == sizeof(bool), VERR_INVALID_PARAMETER);
    630630            break;
     631        case RTLDRPROP_IMPORT_COUNT:
     632            *pcbRet = sizeof(uint32_t);
     633            AssertReturn(cbBuf == sizeof(uint32_t), VERR_INVALID_PARAMETER);
     634            break;
     635        case RTLDRPROP_IMPORT_MODULE:
     636            *pcbRet = sizeof(uint32_t);
     637            AssertReturn(cbBuf >= sizeof(uint32_t), VERR_INVALID_PARAMETER);
     638            break;
    631639
    632640        default:
     
    640648    if (!pMod->pOps->pfnQueryProp)
    641649        return VERR_NOT_SUPPORTED;
    642     return pMod->pOps->pfnQueryProp(pMod, enmProp, pvBuf, cbBuf, pcbRet);
     650    return pMod->pOps->pfnQueryProp(pMod, enmProp, pvBits, pvBuf, cbBuf, pcbRet);
    643651}
    644652RT_EXPORT_SYMBOL(RTLdrQueryPropEx);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette