Sysprogs forums › Forums › VisualDDK/VirtualKD discussion › patch to VBoxDD.cpp for VirtualBox 3.2.0
- This topic has 3 replies, 2 voices, and was last updated 14 years, 4 months ago by xonox.
-
AuthorPosts
-
May 21, 2010 at 18:05 #191xonoxParticipant
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, HANDJuly 6, 2010 at 15:24 #1437AnonymousParticipantCan you post the updated binary VBoxDD.dll? Thanks.
July 6, 2010 at 15:46 #1438xonoxParticipantIn 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
August 14, 2010 at 21:19 #1436AnonymousParticipantThanks
-
AuthorPosts
- You must be logged in to reply to this topic.