Changeset 36437 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 25, 2011 3:36:59 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70801
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r36178 r36437 590 590 static DECLCALLBACK(int) powerDownThread(RTTHREAD Thread, void *pvUser); 591 591 592 static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PVM pVM); 592 static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM); 593 static DECLCALLBACK(void) vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu); 594 static DECLCALLBACK(void) vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM); 593 595 594 596 static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID); … … 682 684 bool mfSnapshotFolderDiskTypeShown : 1; 683 685 684 /** Pointer to the VMM -> User (that's us) callbacks. 685 * This structure is followed by a pointer to the Console object. */ 686 PCVMM2USERMETHODS mpVmm2UserMethods; 686 /** Pointer to the VMM -> User (that's us) callbacks. */ 687 struct MYVMM2USERMETHODS : public VMM2USERMETHODS 688 { 689 Console *pConsole; 690 } *mpVmm2UserMethods; 687 691 688 692 /** The current network attachment type in the VM. -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r36381 r36437 346 346 typedef ListenerImpl<VmEventListener, Console*> VmEventListenerImpl; 347 347 348 348 349 VBOX_LISTENER_DECLARE(VmEventListenerImpl) 349 350 … … 390 391 maStorageDevType[i] = DeviceType_Null; 391 392 392 VMM2USERMETHODS *pVmm2UserMethods = (VMM2USERMETHODS *)RTMemAlloc(sizeof(*mpVmm2UserMethods) + sizeof(Console *));393 MYVMM2USERMETHODS *pVmm2UserMethods = (MYVMM2USERMETHODS *)RTMemAllocZ(sizeof(*mpVmm2UserMethods) + sizeof(Console *)); 393 394 if (!pVmm2UserMethods) 394 395 return E_OUTOFMEMORY; 395 pVmm2UserMethods->u32Magic = VMM2USERMETHODS_MAGIC; 396 pVmm2UserMethods->u32Version = VMM2USERMETHODS_VERSION; 397 pVmm2UserMethods->pfnSaveState = Console::vmm2User_SaveState; 398 pVmm2UserMethods->u32EndMagic = VMM2USERMETHODS_MAGIC; 399 *(Console **)(pVmm2UserMethods + 1) = this; /* lazy bird. */ 396 pVmm2UserMethods->u32Magic = VMM2USERMETHODS_MAGIC; 397 pVmm2UserMethods->u32Version = VMM2USERMETHODS_VERSION; 398 pVmm2UserMethods->pfnSaveState = Console::vmm2User_SaveState; 399 pVmm2UserMethods->pfnNotifyEmtInit = NULL; 400 pVmm2UserMethods->pfnNotifyEmtTerm = Console::vmm2User_NotifyEmtTerm; 401 pVmm2UserMethods->pfnNotifyPdmtInit = NULL; 402 pVmm2UserMethods->pfnNotifyPdmtTerm = Console::vmm2User_NotifyPdmtTerm; 403 pVmm2UserMethods->u32EndMagic = VMM2USERMETHODS_MAGIC; 404 pVmm2UserMethods->pConsole = this; 400 405 mpVmm2UserMethods = pVmm2UserMethods; 401 406 … … 8790 8795 * @interface_method_impl{VMM2USERMETHODS,pfnSaveState} 8791 8796 */ 8792 /*static*/ 8793 DECLCALLBACK(int) Console::vmm2User_SaveState(PCVMM2USERMETHODS pThis, PVM pVM) 8794 { 8795 Console *pConsole = *(Console **)(pThis + 1); /* lazy bird */ 8797 /*static*/ DECLCALLBACK(int) 8798 Console::vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM) 8799 { 8800 Console *pConsole = ((MYVMM2USERMETHODS *)pThis)->pConsole; 8801 NOREF(pUVM); 8796 8802 8797 8803 /* … … 8802 8808 return SUCCEEDED(hrc) ? VINF_SUCCESS : Global::vboxStatusCodeFromCOM(hrc); 8803 8809 } 8810 8811 /** 8812 * @interface_method_impl{VMM2USERMETHODS,pfnNotifyEmtTerm} 8813 */ 8814 /*static*/ DECLCALLBACK(void) 8815 Console::vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu) 8816 { 8817 NOREF(pThis); NOREF(pUVM); NOREF(pUVCpu); 8818 #ifdef RT_OS_WINDOWS 8819 CoUninitialize(); 8820 #endif 8821 } 8822 8823 /** 8824 * @interface_method_impl{VMM2USERMETHODS,pfnNotifyPdmtTerm} 8825 */ 8826 /*static*/ DECLCALLBACK(void) 8827 Console::vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM) 8828 { 8829 NOREF(pThis); NOREF(pUVM); 8830 #ifdef RT_OS_WINDOWS 8831 CoUninitialize(); 8832 #endif 8833 } 8834 8804 8835 8805 8836
Note:
See TracChangeset
for help on using the changeset viewer.