Changeset 52596 in vbox
- Timestamp:
- Sep 4, 2014 4:45:50 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
include/VBox/ExtPack/ExtPack.h (modified) (4 diffs)
-
src/VBox/Main/include/ExtPackManagerImpl.h (modified) (2 diffs)
-
src/VBox/Main/include/SystemPropertiesImpl.h (modified) (2 diffs)
-
src/VBox/Main/include/VirtualBoxImpl.h (modified) (1 diff)
-
src/VBox/Main/src-all/ExtPackManagerImpl.cpp (modified) (6 diffs)
-
src/VBox/Main/src-server/SystemPropertiesImpl.cpp (modified) (3 diffs)
-
src/VBox/Main/src-server/VirtualBoxImpl.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/ExtPack/ExtPack.h
r48313 r52596 4 4 5 5 /* 6 * Copyright (C) 2010-201 3Oracle Corporation6 * Copyright (C) 2010-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 150 150 DECLR3CALLBACKMEMBER(VBOXEXTPACKCTX, pfnGetContext,(PCVBOXEXTPACKHLP pHlp)); 151 151 152 /** 153 * Loads a HGCM service provided by an extension pack. 154 * 155 * @returns VBox status code. 156 * @param pHlp Pointer to this helper structure. 157 * @param pConsole Pointer to the VM's console object. 158 * @param pszServiceLibrary Name of the library file containing the 159 * service implementation, without extension. 160 * @param pszServiceName Name of HGCM service. 161 */ 152 162 DECLR3CALLBACKMEMBER(int, pfnLoadHGCMService,(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IConsole) *pConsole, 153 163 const char *pszServiceLibrary, const char *pszServiceName)); 164 165 /** 166 * Loads a VD plugin provided by an extension pack. 167 * 168 * This makes sense only in the context of the per-user service (VBoxSVC). 169 * 170 * @returns VBox status code. 171 * @param pHlp Pointer to this helper structure. 172 * @param pVirtualBox Pointer to the VirtualBox object. 173 * @param pszPluginLibrary Name of the library file containing the plugin 174 * implementation, without extension. 175 */ 176 DECLR3CALLBACKMEMBER(int, pfnLoadVDPlugin,(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, 177 const char *pszPluginLibrary)); 178 179 /** 180 * Unloads a VD plugin provided by an extension pack. 181 * 182 * This makes sense only in the context of the per-user service (VBoxSVC). 183 * 184 * @returns VBox status code. 185 * @param pHlp Pointer to this helper structure. 186 * @param pVirtualBox Pointer to the VirtualBox object. 187 * @param pszPluginLibrary Name of the library file containing the plugin 188 * implementation, without extension. 189 */ 190 DECLR3CALLBACKMEMBER(int, pfnUnloadVDPlugin,(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, 191 const char *pszPluginLibrary)); 154 192 155 193 DECLR3CALLBACKMEMBER(int, pfnReserved1,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */ … … 159 197 DECLR3CALLBACKMEMBER(int, pfnReserved5,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */ 160 198 DECLR3CALLBACKMEMBER(int, pfnReserved6,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */ 161 DECLR3CALLBACKMEMBER(int, pfnReserved7,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */162 DECLR3CALLBACKMEMBER(int, pfnReserved8,(PCVBOXEXTPACKHLP pHlp)); /**< Reserved for minor structure revisions. */163 199 164 200 /** End of structure marker (VBOXEXTPACKHLP_VERSION). */ … … 166 202 } VBOXEXTPACKHLP; 167 203 /** Current version of the VBOXEXTPACKHLP structure. */ 168 #define VBOXEXTPACKHLP_VERSION RT_MAKE_U32( 1, 1)204 #define VBOXEXTPACKHLP_VERSION RT_MAKE_U32(2, 1) 169 205 170 206 -
trunk/src/VBox/Main/include/ExtPackManagerImpl.h
r50914 r52596 5 5 6 6 /* 7 * Copyright (C) 2010-201 3Oracle Corporation7 * Copyright (C) 2010-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 135 135 static DECLCALLBACK(VBOXEXTPACKCTX) i_hlpGetContext(PCVBOXEXTPACKHLP pHlp); 136 136 static DECLCALLBACK(int) i_hlpLoadHGCMService(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IConsole) *pConsole, const char *pszServiceLibrary, const char *pszServiceName); 137 static DECLCALLBACK(int) i_hlpLoadVDPlugin(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, const char *pszPluginLibrary); 138 static DECLCALLBACK(int) i_hlpUnloadVDPlugin(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, const char *pszPluginLibrary); 137 139 static DECLCALLBACK(int) i_hlpReservedN(PCVBOXEXTPACKHLP pHlp); 138 140 /** @} */ -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r52585 r52596 53 53 ComObjPtr<MediumFormat> i_mediumFormatFromExtension(const Utf8Str &aExt); 54 54 55 void i_extPackInstallNotify(const char *pszExtPackName);56 void i_extPackUninstallNotify(const char *pszExtPackName);55 int i_loadVDPlugin(const char *pszPluginLibrary); 56 int i_unloadVDPlugin(const char *pszPluginLibrary); 57 57 58 58 private: … … 129 129 ULONG *aMaxInstances); 130 130 131 HRESULT i_loadExtPackVDPluginCrypt();132 HRESULT i_unloadExtPackVDPluginCrypt();133 134 131 HRESULT i_getUserHomeDirectory(Utf8Str &strPath); 135 132 HRESULT i_setDefaultMachineFolder(const Utf8Str &strPath); -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r52585 r52596 128 128 void i_updateClientWatcher(); 129 129 130 void i_extPackInstallNotify(const char *pszExtPackName);131 void i_extPackUninstallNotify(const char *pszExtPackName);130 int i_loadVDPlugin(const char *pszPluginLibrary); 131 int i_unloadVDPlugin(const char *pszPluginLibrary); 132 132 133 133 void i_onMachineStateChange(const Guid &aId, MachineState_T aState); -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r52585 r52596 684 684 /* pfnGetContext = */ ExtPack::i_hlpGetContext, 685 685 /* pfnLoadHGCMService = */ ExtPack::i_hlpLoadHGCMService, 686 /* pfnLoadVDPlugin = */ ExtPack::i_hlpLoadVDPlugin, 687 /* pfnUnloadVDPlugin = */ ExtPack::i_hlpUnloadVDPlugin, 686 688 /* pfnReserved1 = */ ExtPack::i_hlpReservedN, 687 689 /* pfnReserved2 = */ ExtPack::i_hlpReservedN, … … 690 692 /* pfnReserved5 = */ ExtPack::i_hlpReservedN, 691 693 /* pfnReserved6 = */ ExtPack::i_hlpReservedN, 692 /* pfnReserved7 = */ ExtPack::i_hlpReservedN,693 /* pfnReserved8 = */ ExtPack::i_hlpReservedN,694 694 /* u32EndMarker = */ VBOXEXTPACKHLP_VERSION 695 695 }; … … 1560 1560 #else 1561 1561 NOREF(pHlp); NOREF(pConsole); NOREF(pszServiceLibrary); NOREF(pszServiceName); 1562 #endif 1563 return VERR_INVALID_STATE; 1564 } 1565 1566 /*static*/ DECLCALLBACK(int) 1567 ExtPack::i_hlpLoadVDPlugin(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, const char *pszPluginLibrary) 1568 { 1569 #ifndef VBOX_COM_INPROC 1570 /* 1571 * Validate the input and get our bearings. 1572 */ 1573 AssertPtrReturn(pszPluginLibrary, VERR_INVALID_POINTER); 1574 1575 AssertPtrReturn(pHlp, VERR_INVALID_POINTER); 1576 AssertReturn(pHlp->u32Version == VBOXEXTPACKHLP_VERSION, VERR_INVALID_POINTER); 1577 ExtPack::Data *m = RT_FROM_CPP_MEMBER(pHlp, Data, Hlp); 1578 AssertPtrReturn(m, VERR_INVALID_POINTER); 1579 ExtPack *pThis = m->pThis; 1580 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 1581 AssertPtrReturn(pVirtualBox, VERR_INVALID_POINTER); 1582 1583 VirtualBox *pVBox = (VirtualBox *)pVirtualBox; 1584 return pVBox->i_loadVDPlugin(pszPluginLibrary); 1585 #else 1586 NOREF(pHlp); NOREF(pVirtualBox); 1587 #endif 1588 return VERR_INVALID_STATE; 1589 } 1590 1591 /*static*/ DECLCALLBACK(int) 1592 ExtPack::i_hlpUnloadVDPlugin(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, const char *pszPluginLibrary) 1593 { 1594 #ifndef VBOX_COM_INPROC 1595 /* 1596 * Validate the input and get our bearings. 1597 */ 1598 AssertPtrReturn(pszPluginLibrary, VERR_INVALID_POINTER); 1599 1600 AssertPtrReturn(pHlp, VERR_INVALID_POINTER); 1601 AssertReturn(pHlp->u32Version == VBOXEXTPACKHLP_VERSION, VERR_INVALID_POINTER); 1602 ExtPack::Data *m = RT_FROM_CPP_MEMBER(pHlp, Data, Hlp); 1603 AssertPtrReturn(m, VERR_INVALID_POINTER); 1604 ExtPack *pThis = m->pThis; 1605 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 1606 AssertPtrReturn(pVirtualBox, VERR_INVALID_POINTER); 1607 1608 VirtualBox *pVBox = (VirtualBox *)pVirtualBox; 1609 return pVBox->i_unloadVDPlugin(pszPluginLibrary); 1610 #else 1611 NOREF(pHlp); NOREF(pVirtualBox); 1562 1612 #endif 1563 1613 return VERR_INVALID_STATE; … … 2530 2580 { 2531 2581 if (pExtPack && a_fReplace) 2532 {2533 m->pVirtualBox->i_extPackUninstallNotify(pStrName->c_str());2534 2582 hrc = pExtPack->i_callUninstallHookAndClose(m->pVirtualBox, false /*a_ForcedRemoval*/); 2535 }2536 2583 else if (pExtPack) 2537 2584 hrc = setError(E_FAIL, … … 2565 2612 pExtPack->i_callInstalledHook(m->pVirtualBox, &autoLock, &ErrInfo.Core); 2566 2613 if (RT_SUCCESS(ErrInfo.Core.rc)) 2567 {2568 2614 LogRel(("ExtPackManager: Successfully installed extension pack '%s'.\n", pStrName->c_str())); 2569 m->pVirtualBox->i_extPackInstallNotify(pStrName->c_str());2570 }2571 2615 else 2572 2616 { … … 2671 2715 * Call the uninstall hook and unload the main dll. 2672 2716 */ 2673 m->pVirtualBox->i_extPackUninstallNotify(a_pstrName->c_str());2674 2717 hrc = pExtPack->i_callUninstallHookAndClose(m->pVirtualBox, a_fForcedRemoval); 2675 2718 if (SUCCEEDED(hrc)) -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r52585 r52596 44 44 ///////////////////////////////////////////////////////////////////////////// 45 45 46 // globals47 /////////////////////////////////////////////////////////////////////////////48 static const Utf8Str g_strExtPackPuel("Oracle VM VirtualBox Extension Pack");49 static const char *g_pszVDPluginCrypt = "VDPluginCrypt";50 51 46 // constructor / destructor 52 47 ///////////////////////////////////////////////////////////////////////////// … … 117 112 118 113 HRESULT rc = S_OK; 119 120 /* Load all VD plugins from all extension packs first. */121 /** @todo: Make generic for 4.4 (requires interface changes). */122 rc = i_loadExtPackVDPluginCrypt();123 114 124 115 /* Fetch info of all available hd backends. */ … … 1119 1110 1120 1111 /** 1121 * Extension pack install notification1112 * VD plugin load 1122 1113 */ 1123 void SystemProperties::i_extPackInstallNotify(const char *pszExtPackName) 1124 { 1125 if (g_strExtPackPuel.equals(pszExtPackName)) 1126 { 1127 i_loadExtPackVDPluginCrypt(); 1128 } 1114 int SystemProperties::i_loadVDPlugin(const char *pszPluginLibrary) 1115 { 1116 return VDPluginLoadFromFilename(pszPluginLibrary); 1129 1117 } 1130 1118 1131 1119 /** 1132 * Extension pack uninstall notification1120 * VD plugin unload 1133 1121 */ 1134 void SystemProperties::i_extPackUninstallNotify(const char *pszExtPackName) 1135 { 1136 if (g_strExtPackPuel.equals(pszExtPackName)) 1137 { 1138 i_unloadExtPackVDPluginCrypt(); 1139 } 1140 } 1141 1142 HRESULT SystemProperties::i_loadExtPackVDPluginCrypt() 1143 { 1144 HRESULT rc = S_OK; 1145 #ifdef VBOX_WITH_EXTPACK 1146 if (mParent->i_getExtPackManager()->i_isExtPackUsable(g_strExtPackPuel.c_str())) 1147 { 1148 Utf8Str strPlugin; 1149 rc = mParent->i_getExtPackManager()->i_getLibraryPathForExtPack(g_pszVDPluginCrypt, &g_strExtPackPuel, &strPlugin); 1150 if (SUCCEEDED(rc)) 1151 { 1152 int vrc = VDPluginLoadFromFilename(strPlugin.c_str()); 1153 NOREF(vrc); /** @todo: don't ignore errors. */ 1154 } 1155 else 1156 rc = S_OK; /* ignore errors */ 1157 } 1158 # endif 1159 return rc; 1160 } 1161 1162 HRESULT SystemProperties::i_unloadExtPackVDPluginCrypt() 1163 { 1164 HRESULT rc = S_OK; 1165 #ifdef VBOX_WITH_EXTPACK 1166 Utf8Str strPlugin; 1167 rc = mParent->i_getExtPackManager()->i_getLibraryPathForExtPack(g_pszVDPluginCrypt, &g_strExtPackPuel, &strPlugin); 1168 if (SUCCEEDED(rc)) 1169 { 1170 int vrc = VDPluginUnloadFromFilename(strPlugin.c_str()); 1171 NOREF(vrc); /** @todo: don't ignore errors. */ 1172 } 1173 else 1174 rc = S_OK; /* ignore errors */ 1175 # endif 1176 return rc; 1122 int SystemProperties::i_unloadVDPlugin(const char *pszPluginLibrary) 1123 { 1124 return VDPluginUnloadFromFilename(pszPluginLibrary); 1177 1125 } 1178 1126 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r52585 r52596 1371 1371 0xa0, 0xd7af, '\0' }; 1372 1372 char *pszName = strName.mutableRaw(); 1373 int cReplacements = RTStrPurgeComplementSet(pszName, aCpSet, '_');1373 ssize_t cReplacements = RTStrPurgeComplementSet(pszName, aCpSet, '_'); 1374 1374 Assert(cReplacements >= 0); 1375 1375 NOREF(cReplacements); … … 2637 2637 2638 2638 /** 2639 * Extpack install notification2640 */ 2641 void VirtualBox::i_extPackInstallNotify(const char *pszExtPackName)2642 { 2643 m->pSystemProperties->i_extPackInstallNotify(pszExtPackName);2644 } 2645 2646 /** 2647 * Extpack uninstall notification2648 */ 2649 void VirtualBox::i_extPackUninstallNotify(const char *pszExtPackName)2650 { 2651 m->pSystemProperties->i_extPackUninstallNotify(pszExtPackName);2639 * VD plugin load 2640 */ 2641 int VirtualBox::i_loadVDPlugin(const char *pszPluginLibrary) 2642 { 2643 return m->pSystemProperties->i_loadVDPlugin(pszPluginLibrary); 2644 } 2645 2646 /** 2647 * VD plugin unload 2648 */ 2649 int VirtualBox::i_unloadVDPlugin(const char *pszPluginLibrary) 2650 { 2651 return m->pSystemProperties->i_unloadVDPlugin(pszPluginLibrary); 2652 2652 } 2653 2653
Note:
See TracChangeset
for help on using the changeset viewer.

