patch to VBoxDD.cpp for VirtualBox 3.2.0

Sysprogs forums Forums VisualDDK/VirtualKD discussion patch to VBoxDD.cpp for VirtualBox 3.2.0

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #191
    xonox
    Participant

    VirtualBox 3.2.0 crashes with the VBoxDD.dll currently available in http://virtualkd.sysprogs.org/VBoxPatch-3.1.0.zip. I patched VBoxDD.cpp and recompiled it against the VirtualBox 3.2.0 sources to get it working again. Because I am not sure what license applies to VirtualKD I’ll refrain from uploading the compiled DLLs somewhere and just post the diff of the changes here:

    --- VirtualKD-2.3-sources.orig/VBoxDD/VBoxDD.cpp        2009-06-07 16:31:54.000000000 +0200
    +++ VirtualKD-2.3-sources/VBoxDD/VBoxDD.cpp     2010-05-21 18:45:04.760667800 +0200
    @@ -12,7 +12,7 @@
    {
    if (!s_pOriginalDevReg)
    return VINF_OBJECT_DESTROYED;
    -       pDevIns->pDevReg = s_pOriginalDevReg;
    + pDevIns->pReg = s_pOriginalDevReg;
    int rc = s_pOriginalDevReg->pfnConstruct(pDevIns, iInstance, pCfgHandle);
    if (!RT_SUCCESS(rc))
    return rc;
    @@ -29,29 +29,29 @@
    DevRegisterCallbacksHook(const PDMDEVREGCB &Callbacks) : PDMDEVREGCB(Callbacks)
    {
    pfnRegister = &RegisterOverride;
    - pfnMMHeapAlloc = &AllocOverride;
    +// pfnMMHeapAlloc = &AllocOverride;
    }

    - static int RTCALL RegisterOverride(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pDevReg)
    + static int RTCALL RegisterOverride(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pReg)
    {
    - if (pDevReg)
    + if (pReg)
    {
    - if (!strcmp(VIRTUALKD_HOOKED_VBOX_DEVICE_NAME, pDevReg->szDeviceName))
    + if (!strcmp(VIRTUALKD_HOOKED_VBOX_DEVICE_NAME, pReg->szName))
    {
    - PPDMDEVREG pReg = new PDMDEVREG();
    - *pReg = *pDevReg;
    - s_pOriginalDevReg = pDevReg;
    - pReg->pfnConstruct = ConstructOverride;
    - pDevReg = pReg;
    + PPDMDEVREG pMyReg = new PDMDEVREG();
    + *pMyReg = *pReg;
    + s_pOriginalDevReg = pReg;
    + pMyReg->pfnConstruct = ConstructOverride;
    + pReg = pMyReg;
    }
    }
    - return ((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks->pfnRegister(((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks, pDevReg);
    + return ((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks->pfnRegister(((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks, pReg);
    }

    - static void * RTCALL AllocOverride(PPDMDEVREGCB pCallbacks, size_t cb)
    - {
    - return ((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks->pfnMMHeapAlloc(((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks, cb);
    - }
    +// static void * RTCALL AllocOverride(PPDMDEVREGCB pCallbacks, size_t cb)
    +// {
    +// return ((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks->pfnMMHeapAlloc(((DevRegisterCallbacksHook *)pCallbacks)->pOriginalCallbacks, cb);
    +// }
    };

    extern "C"

    P.S.: I couldn’t find any documentation about the pfnMMHeapAlloc callback removal, i.e. I am not sure if this fubars VirtualBox’ memory management… You probably do not want to use this in a production environment.
    HTH, HAND

    #1437
    Anonymous
    Participant

    Can you post the updated binary VBoxDD.dll? Thanks.

    #1438
    xonox
    Participant

    In the hope that nobody cares about licensing or copyright issues, here is my latest build for VirtualBox 3.2.6:

    http://rapidshare.com/files/405324229/VBoxPatch-3.2.6.zip

    Cheers, xonox

    #1436
    Anonymous
    Participant

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.