Changeset 69785 in vbox
- Timestamp:
- Nov 20, 2017 8:18:32 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119190
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r69782 r69785 24402 24402 <!-- 24403 24403 // IVirtualBoxSDS 24404 // Note! This actually extends IUnknown rather than IDispatch, notdual=yes 24405 // sees to that. 24404 24406 ////////////////////////////////////////////////////////////////////////// 24405 24407 --> 24406 24408 24407 <!-- This is now an internal interface, it doesn't need to be dual either. -->24408 24409 <interface 24409 name="IVirtualBoxSDS" extends="$unknown" 24410 name="IVirtualBoxSDS" extends="$unknown" notdual="yes" 24410 24411 uuid="787d20ed-faf3-4170-6697-3a2a7de6e086" 24411 wsmap="suppress" 24412 wsmap="suppress" internal="yes" 24412 24413 reservedMethods="0" reservedAttributes="0" 24413 24414 > -
trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h
r69784 r69785 19 19 #define ____H_VIRTUALBOXSDSIMPL 20 20 21 #include "VirtualBoxSDSWrap.h" 22 #include "TokenWrap.h" 23 24 #ifdef RT_OS_WINDOWS 25 # include "win/resource.h" 26 #endif 21 #include "VirtualBoxBase.h" 27 22 28 23 … … 68 63 69 64 70 class ATL_NO_VTABLE VirtualBoxSDS : 71 public VirtualBoxSDSWrap 72 #ifdef RT_OS_WINDOWS 65 /** 66 * The IVirtualBoxSDS implementation. 67 * 68 * This class helps different VBoxSVC processes make sure a user only have a 69 * single VirtualBox instance. 70 * 71 * @note This is a simple internal class living in a privileged process. So, we 72 * do not use the API wrappers as they add complexity. In particular, 73 * they add the auto caller logic, which is an excellent tool to create 74 * unkillable processes. If an API method during development or product 75 * for instance triggers an NT exception like STATUS_ACCESS_VIOLATION, the 76 * caller will be unwound without releasing the caller. When uninit is 77 * called during COM shutdown/whatever, the thread gets stuck waiting for 78 * the long gone caller and cannot be killed (Windows 10, build 16299), 79 * requiring a reboot to continue. 80 * 81 * @todo Would be very nice to get rid of the ATL cruft too here. 82 */ 83 class VirtualBoxSDS 84 : public IVirtualBoxSDS 85 , public ATL::CComObjectRootEx<ATL::CComMultiThreadModel> 73 86 , public ATL::CComCoClass<VirtualBoxSDS, &CLSID_VirtualBoxSDS> 74 #endif75 87 { 76 88 private: … … 82 94 83 95 public: 96 DECLARE_CLASSFACTORY_SINGLETON(VirtualBoxSDS) 97 DECLARE_NOT_AGGREGATABLE(VirtualBoxSDS) 98 DECLARE_PROTECT_FINAL_CONSTRUCT() 84 99 85 DECLARE_CLASSFACTORY_SINGLETON(VirtualBoxSDS) 86 87 //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX) 88 89 // Kind of redundant (VirtualBoxSDSWrap declares itself not aggregatable 90 // and CComCoClass<VirtualBoxSDS, &CLSID_VirtualBoxSDS> as aggregatable, 91 // the former is the first inheritance), but the C multiple inheritance 92 // rules and the class factory in VBoxSDS.cpp needs this to disambiguate. 93 DECLARE_NOT_AGGREGATABLE(VirtualBoxSDS) 100 BEGIN_COM_MAP(VirtualBoxSDS) 101 COM_INTERFACE_ENTRY(IVirtualBoxSDS) 102 END_COM_MAP() 94 103 95 104 DECLARE_EMPTY_CTOR_DTOR(VirtualBoxSDS) 96 105 97 106 HRESULT FinalConstruct(); 98 void FinalRelease(); 99 100 // public initializers/uninitializers for internal purposes only 101 HRESULT init(); 102 void uninit(); 107 void FinalRelease(); 103 108 104 109 private: 105 110 106 // WrappedIVirtualBoxSDS methods107 HRESULT registerVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid, ComPtr<IUnknown> &aExistingVirtualBox);108 HRESULT deregisterVBoxSVC(const ComPtr<IVBoxSVCRegistration> &aVBoxSVC, LONG aPid);111 // IVirtualBoxSDS methods 112 HRESULT RegisterVBoxSVC(IVBoxSVCRegistration *aVBoxSVC, LONG aPid, IUnknown **aExistingVirtualBox); 113 HRESULT DeregisterVBoxSVC(IVBoxSVCRegistration *aVBoxSVC, LONG aPid); 109 114 110 115
Note:
See TracChangeset
for help on using the changeset viewer.