- Timestamp:
- Nov 4, 2010 2:04:20 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67402
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ExtPackManagerImpl.cpp
r33695 r33765 833 833 HRESULT ExtPackManager::init(const char *a_pszDropZoneDir, bool a_fCheckDropZone) 834 834 { 835 AutoInitSpan autoInitSpan(this); 836 AssertReturn(autoInitSpan.isOk(), E_FAIL); 837 835 838 /* 836 839 * Figure some stuff out before creating the instance data. … … 863 866 * that exceed the max name length in RTDIRENTRYEX. 864 867 */ 868 HRESULT hrc = S_OK; 865 869 PRTDIR pDir; 866 870 int vrc = RTDirOpen(&pDir, szBaseDir); 867 if (RT_FAILURE(vrc)) 868 return S_OK; 869 HRESULT hrc = S_OK; 870 for (;;) 871 { 872 RTDIRENTRYEX Entry; 873 vrc = RTDirReadEx(pDir, &Entry, NULL /*pcbDirEntry*/, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 874 if (RT_FAILURE(vrc)) 875 { 876 AssertLogRelMsg(vrc == VERR_NO_MORE_FILES, ("%Rrc\n", vrc)); 877 break; 878 } 879 if ( RTFS_IS_DIRECTORY(Entry.Info.Attr.fMode) 880 && strcmp(Entry.szName, ".") != 0 881 && strcmp(Entry.szName, "..") != 0 ) 882 { 883 /* 884 * All directories are extensions, the shall be nothing but 885 * extensions in this subdirectory. 886 */ 887 ComObjPtr<ExtPack> NewExtPack; 888 HRESULT hrc2 = NewExtPack.createObject(); 889 if (SUCCEEDED(hrc2)) 890 hrc2 = NewExtPack->init(Entry.szName, szBaseDir); 891 if (SUCCEEDED(hrc2)) 892 m->llInstalledExtPacks.push_back(NewExtPack); 893 else if (SUCCEEDED(rc)) 894 hrc = hrc2; 895 } 896 } 897 RTDirClose(pDir); 871 if (RT_SUCCESS(vrc)) 872 { 873 for (;;) 874 { 875 RTDIRENTRYEX Entry; 876 vrc = RTDirReadEx(pDir, &Entry, NULL /*pcbDirEntry*/, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 877 if (RT_FAILURE(vrc)) 878 { 879 AssertLogRelMsg(vrc == VERR_NO_MORE_FILES, ("%Rrc\n", vrc)); 880 break; 881 } 882 if ( RTFS_IS_DIRECTORY(Entry.Info.Attr.fMode) 883 && strcmp(Entry.szName, ".") != 0 884 && strcmp(Entry.szName, "..") != 0 ) 885 { 886 /* 887 * All directories are extensions, the shall be nothing but 888 * extensions in this subdirectory. 889 */ 890 ComObjPtr<ExtPack> NewExtPack; 891 HRESULT hrc2 = NewExtPack.createObject(); 892 if (SUCCEEDED(hrc2)) 893 hrc2 = NewExtPack->init(Entry.szName, szBaseDir); 894 if (SUCCEEDED(hrc2)) 895 m->llInstalledExtPacks.push_back(NewExtPack); 896 else if (SUCCEEDED(rc)) 897 hrc = hrc2; 898 } 899 } 900 RTDirClose(pDir); 901 } 902 /* else: ignore, the directory probably does not exist or something. */ 898 903 899 904 /* … … 903 908 processDropZone(); 904 909 910 if (SUCCEEDED(hrc)) 911 autoInitSpan.setSucceeded(); 905 912 return hrc; 906 913 } -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r33691 r33765 64 64 #include "DHCPServerImpl.h" 65 65 #ifdef VBOX_WITH_RESOURCE_USAGE_API 66 # include "PerformanceImpl.h"66 # include "PerformanceImpl.h" 67 67 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 68 68 #include "EventImpl.h" 69 #ifdef VBOX_WITH_EXTPACK 70 # include "ExtPackManagerImpl.h" 71 #endif 69 72 70 73 #include "AutoCaller.h" … … 320 323 EventQueue * const pAsyncEventQ; 321 324 const ComObjPtr<EventSource> pEventSource; 325 326 #ifdef VBOX_WITH_EXTPACK 327 /** The extension pack manager object lives here. */ 328 const ComObjPtr<ExtPackManager> ptrExtPackManager; 329 #endif 322 330 }; 323 331 … … 490 498 rc = m->pEventSource->init(static_cast<IVirtualBox*>(this)); 491 499 if (FAILED(rc)) throw rc; 500 501 #ifdef VBOX_WITH_EXTPACK 502 /* extension manager */ 503 rc = unconst(m->ptrExtPackManager).createObject(); 504 if (SUCCEEDED(rc)) 505 /** @todo Define drop zone location. */ 506 rc = m->ptrExtPackManager->init(NULL /*a_pszDropZoneDir*/, false /*a_fCheckDropZone*/); 507 if (FAILED(rc)) 508 throw rc; 509 #endif 492 510 } 493 511 catch (HRESULT err) … … 1055 1073 1056 1074 return S_OK; 1075 } 1076 1077 STDMETHODIMP 1078 VirtualBox::COMGETTER(ExtensionPackManager)(IExtPackManager **aExtPackManager) 1079 { 1080 CheckComArgOutPointerValid(aExtPackManager); 1081 1082 AutoCaller autoCaller(this); 1083 HRESULT hrc = autoCaller.rc(); 1084 if (SUCCEEDED(hrc)) 1085 { 1086 #ifdef VBOX_WITH_EXTPACK 1087 /* The extension pack manager is const, no need to lock. */ 1088 hrc = m->ptrExtPackManager.queryInterfaceTo(aExtPackManager); 1089 #else 1090 hrc = E_NOTIMPL; 1091 #endif 1092 } 1093 1094 return hrc; 1057 1095 } 1058 1096 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r33657 r33765 1375 1375 <interface 1376 1376 name="IVirtualBox" extends="$unknown" 1377 uuid=" b59d8e0a-9aeb-4196-a5e9-398970ddbae5"1377 uuid="e03d6527-9b72-43b5-b87f-88f1033d3866" 1378 1378 wsmap="managed" 1379 1379 > … … 1505 1505 <attribute name="DHCPServers" type="IDHCPServer" safearray="yes" readonly="yes"> 1506 1506 <desc> 1507 dhcp server settings.1507 DHCP servers. 1508 1508 </desc> 1509 1509 </attribute> … … 1514 1514 </desc> 1515 1515 </attribute> 1516 1517 <attribute name="extensionPackManager" type="IExtPackManager" readonly="yes"> 1518 <desc> 1519 The extension pack manager. 1520 </desc> 1521 </attribute> 1522 1516 1523 1517 1524 <method name="composeMachineFilename"> … … 14001 14008 <interface 14002 14009 name="IExtPack" extends="$unknown" 14003 uuid=" 1b69431b-b22f-454a-977d-7d50986defcb"14010 uuid="ab26b24e-d46c-4d09-aa44-e5092d2fe9ae" 14004 14011 wsmap="suppress" 14005 14012 > … … 14011 14018 <attribute name="name" type="wstring" readonly="yes"> 14012 14019 <desc>The extension pack name. This is unique.</desc> 14020 </attribute> 14021 <attribute name="description" type="wstring" readonly="yes"> 14022 <desc>The extension pack description.</desc> 14013 14023 </attribute> 14014 14024 <attribute name="version" type="wstring" readonly="yes"> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r33556 r33765 120 120 STDMETHOD(COMGETTER(DHCPServers)) (ComSafeArrayOut(IDHCPServer *, aDHCPServers)); 121 121 STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource); 122 STDMETHOD(COMGETTER(ExtensionPackManager)) (IExtPackManager **aExtPackManager); 122 123 123 124 /* IVirtualBox methods */
Note:
See TracChangeset
for help on using the changeset viewer.