Changeset 47561 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Aug 6, 2013 3:18:17 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87761
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MachineImpl.h
r47409 r47561 783 783 } 784 784 785 #if defined(RT_OS_WINDOWS)786 787 bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,788 ComPtr<IInternalSessionControl> *aControl = NULL,789 HANDLE *aIPCSem = NULL, bool aAllowClosing = false);790 bool isSessionSpawning(RTPROCESS *aPID = NULL);791 792 bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,793 ComPtr<IInternalSessionControl> *aControl = NULL,794 HANDLE *aIPCSem = NULL)795 { return isSessionOpen(aMachine, aControl, aIPCSem, true /* aAllowClosing */); }796 797 #elif defined(RT_OS_OS2)798 799 bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,800 ComPtr<IInternalSessionControl> *aControl = NULL,801 HMTX *aIPCSem = NULL, bool aAllowClosing = false);802 803 bool isSessionSpawning(RTPROCESS *aPID = NULL);804 805 bool isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,806 ComPtr<IInternalSessionControl> *aControl = NULL,807 HMTX *aIPCSem = NULL)808 { return isSessionOpen(aMachine, aControl, aIPCSem, true /* aAllowClosing */); }809 810 #else811 812 785 bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine, 813 786 ComPtr<IInternalSessionControl> *aControl = NULL, … … 819 792 { return isSessionOpen(aMachine, aControl, true /* aAllowClosing */); } 820 793 821 #endif822 823 794 bool checkForSpawnFailure(); 824 795 … … 848 819 849 820 protected: 821 822 class ClientToken; 850 823 851 824 HRESULT checkStateDependency(StateDependency aDepType); … … 1075 1048 STDMETHOD(SetRemoveSavedStateFile)(BOOL aRemove); 1076 1049 STDMETHOD(UpdateState)(MachineState_T machineState); 1077 STDMETHOD(GetIPCId)(BSTR *id);1078 1050 STDMETHOD(BeginPowerUp)(IProgress *aProgress); 1079 1051 STDMETHOD(EndPowerUp)(LONG iResult); … … 1134 1106 bool checkForDeath(); 1135 1107 1108 void getTokenId(Utf8Str &strTokenId); 1109 // getClientToken must be only used by callers who can guarantee that 1110 // the object cannot be deleted in the mean time, i.e. have a caller/lock. 1111 ClientToken *getClientToken(); 1112 1136 1113 HRESULT onNetworkAdapterChange(INetworkAdapter *networkAdapter, BOOL changeAdapter); 1137 1114 HRESULT onNATRedirectRuleChange(ULONG ulSlot, BOOL aNatRuleRemove, IN_BSTR aRuleName, … … 1236 1213 ConsoleTaskData mConsoleTaskData; 1237 1214 1238 /** interprocess semaphore handle for this machine */ 1239 #if defined(RT_OS_WINDOWS) 1240 HANDLE mIPCSem; 1241 Bstr mIPCSemName; 1242 friend bool Machine::isSessionOpen(ComObjPtr<SessionMachine> &aMachine, 1243 ComPtr<IInternalSessionControl> *aControl, 1244 HANDLE *aIPCSem, bool aAllowClosing); 1245 #elif defined(RT_OS_OS2) 1246 HMTX mIPCSem; 1247 Bstr mIPCSemName; 1248 friend bool Machine::isSessionOpen(ComObjPtr<SessionMachine> &aMachine, 1249 ComPtr<IInternalSessionControl> *aControl, 1250 HMTX *aIPCSem, bool aAllowClosing); 1251 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 1252 int mIPCSem; 1253 # ifdef VBOX_WITH_NEW_SYS_V_KEYGEN 1254 Bstr mIPCKey; 1255 # endif /*VBOX_WITH_NEW_SYS_V_KEYGEN */ 1256 #else 1257 # error "Port me!" 1258 #endif 1215 /** client token for this machine */ 1216 ClientToken *mClientToken; 1259 1217 1260 1218 static DECLCALLBACK(int) taskHandler(RTTHREAD thread, void *pvUser); -
trunk/src/VBox/Main/include/SessionImpl.h
r46775 r47561 24 24 #ifdef RT_OS_WINDOWS 25 25 # include "win/resource.h" 26 #endif27 28 /** @def VBOX_WITH_SYS_V_IPC_SESSION_WATCHER29 * Use SYS V IPC for watching a session.30 * This is defined in the Makefile since it's also used by MachineImpl.h/cpp.31 */32 #ifdef DOXYGEN_RUNNING33 # define VBOX_WITH_SYS_V_IPC_SESSION_WATCHER34 26 #endif 35 27 … … 81 73 STDMETHOD(GetPID)(ULONG *aPid); 82 74 STDMETHOD(GetRemoteConsole)(IConsole **aConsole); 83 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType );75 STDMETHOD(AssignMachine)(IMachine *aMachine, LockType_T aLockType, IN_BSTR aTokenId); 84 76 STDMETHOD(AssignRemoteMachine)(IMachine *aMachine, IConsole *aConsole); 85 77 STDMETHOD(UpdateMachineState)(MachineState_T aMachineState); … … 124 116 125 117 HRESULT unlockMachine(bool aFinalRelease, bool aFromServer); 126 HRESULT grabIPCSemaphore();127 void releaseIPCSemaphore();128 118 129 119 SessionState_T mState; … … 139 129 ComPtr<IVirtualBox> mVirtualBox; 140 130 141 /* interprocess semaphore handle (id) for the opened machine */ 142 #if defined(RT_OS_WINDOWS) 143 HANDLE mIPCSem; 144 HANDLE mIPCThreadSem; 145 #elif defined(RT_OS_OS2) 146 RTTHREAD mIPCThread; 147 RTSEMEVENT mIPCThreadSem; 148 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 149 int mIPCSem; 150 #else 151 # error "Port me!" 152 #endif 131 class ClientTokenHolder; 132 133 ClientTokenHolder *mClientTokenHolder; 153 134 }; 154 135 -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r47525 r47561 20 20 21 21 #include "VirtualBoxBase.h" 22 #include "objectslist.h" 22 23 23 24 #ifdef RT_OS_WINDOWS … … 33 34 class SessionMachine; 34 35 class GuestOSType; 35 class SharedFolder;36 36 class Progress; 37 37 class Host; … … 39 39 class DHCPServer; 40 40 class PerformanceCollector; 41 class VirtualBoxCallbackRegistration; /* see VirtualBoxImpl.cpp */42 41 #ifdef VBOX_WITH_EXTPACK 43 42 class ExtPackManager; … … 52 51 class SVCHlpClient; 53 52 #endif 54 55 struct VMClientWatcherData;56 53 57 54 namespace settings … … 71 68 72 69 typedef std::list<ComPtr<IInternalSessionControl> > InternalControlList; 70 typedef ObjectsList<Machine> MachinesOList; 73 71 74 72 class CallbackEvent; … … 216 214 void onGuestPropertyChange(const Guid &aMachineId, IN_BSTR aName, IN_BSTR aValue, 217 215 IN_BSTR aFlags); 218 void onMachineUninit(Machine *aMachine);219 216 void onNatRedirectChange(const Guid &aMachineId, ULONG ulSlot, bool fRemove, IN_BSTR aName, 220 217 NATProtocol_T aProto, IN_BSTR aHostIp, uint16_t aHostPort, … … 234 231 void getOpenedMachines(SessionMachinesList &aMachines, 235 232 InternalControlList *aControls = NULL); 233 MachinesOList &getMachinesList(); 236 234 237 235 HRESULT findMachine(const Guid &aId, … … 322 320 323 321 private: 322 class ClientWatcher; 324 323 325 324 static HRESULT setErrorStatic(HRESULT aResultCode, … … 361 360 static Bstr sAPIVersion; 362 361 363 static DECLCALLBACK(int) ClientWatcher(RTTHREAD thread, void *pvUser);364 362 static DECLCALLBACK(int) AsyncEventHandler(RTTHREAD thread, void *pvUser); 365 363
Note:
See TracChangeset
for help on using the changeset viewer.